title: C# Process Name, but not like 'chrome(.exe)' but like 'Chrome'
body: <p>Maybe a weird question, but i did not really know how to ask it, hope i made my point clear in the title.</p>
  
  <p>Code i have so far:</p>
  
  <pre><code>    /// &lt;summary&gt;
      /// Get the process that is currently running on the foreground
      /// &lt;/summary&gt;
      /// &lt;returns&gt;Proces object containing all information about the process that is running on the foreground&lt;/returns&gt;
      public static Process GetCurrentRunningProcess()
      {
          Process[] processes = Process.GetProcesses();
          IntPtr activeWindow = GetForegroundWindow();
  
          foreach (Process process in processes)
          {
              if (process.MainWindowHandle == activeWindow)
                  return process;
          }
  
          return null;
      }
  
      /// &lt;summary&gt;
      /// Get the Foreground Window using the user32.dll
      /// &lt;/summary&gt;
      /// &lt;returns&gt;The handle of the window&lt;/returns&gt;
      [DllImport("user32", SetLastError = true)]
      public static extern IntPtr GetForegroundWindow();
  </code></pre>
  
  <p>This is what I'm doing right now, and it get's me the Process which contains a ProcessName. In my case I get 'chrome' where i actually want 'Chrome' or when I have notepad(.exe) i want Notepad. Is there a way to achieve this? Or do I have to make a list with program names and compare it with the ProcessName?</p>