//确保窗口没有被最小化或最大化
ShowWindowAsync (ptr , WS_SHOWNORMAL);
//设置真实例程为foreground window
SetForegroundWindow (ptr);
[DllImport("User32.dll")]
public static extern bool ShowWindowAsync(
IntPtr hWnd, int cmdShow);
[DllImport("User32.dll")] private static extern bool
SetForegroundWindow(IntPtr hWnd);