public static void ActivateWindow( IntPtr hwnd) { if (hwnd != IntPtr.Zero) { WindowNative.SetActiveWindow(hwnd); } }