[DllImport("user32.dll")]
private static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
const int SWP_SHOWWINDOW = 0x0040;
在load下面代码:
//Join WinAPI Setting Focse();
IntPtr handle = new WindowInteropHelper(this).Handle;
SetWindowPos(handle, HWND_TOPMOST, 0, 0, 100, 200, SWP_SHOWWINDOW);