WPF设置窗体最前端显示

2016-08-20 10:38:42来源:http://studybao.blog.51cto.com/1772164/1368962作者:StudyBao人点击


[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);

原文链接:

http://www.cnblogs.com/xchit/archive/2012/09/13/2683180.html


最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台