Guest User

Untitled

a guest
Mar 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Process[] processes = Process.GetProcesses();
  2.  
  3. foreach (var process in processes)
  4. {
  5. Console.WriteLine("Process Name: {0} ", process.ProcessName);
  6.  
  7. if (process.ProcessName.Contains("chrome"))
  8. {
  9. IntPtr handle = process.MainWindowHandle;
  10.  
  11. SetForegroundWindow(handle);
  12. SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOZORDER);
  13. }
  14. }
  15. MessageBox.Show("OK");
Add Comment
Please, Sign In to add comment