Esempio n. 1
0
 public static void ByProcAndName(string process, string title)
 {
     if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
     {
         BringToForeGroundLinux.BringToFront(title);
         return;
     }
     setForegroundByHwnd(findWindow(process, title));
 }
Esempio n. 2
0
 private static void setForegroundByHwnd(IntPtr hWnd)
 {
     if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
     {
         BringToForeGroundLinux.BringToFront(hWnd);
     }
     else
     {
         BringToForeGroundWindows.BringToFront(hWnd);
     }
 }
Esempio n. 3
0
        private static void setForegroundByPid(int pid)
        {
            var proc = Process.GetProcessById(pid);

            if (proc != null)
            {
                if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
                {
                    BringToForeGroundLinux.BringToFront(pid);
                }
                else
                {
                    setForegroundByHwnd(proc.MainWindowHandle);
                }
            }
        }