BringToFront() public static method

public static BringToFront ( IntPtr hWnd ) : void
hWnd System.IntPtr
return void
示例#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));
 }
示例#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);
     }
 }
示例#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);
                }
            }
        }