代码改变世界

随笔档案-2012年9月13日

WinAPI: SetWindowPos - 改变窗口的位置与状态

2012-09-13 13:28 by xchit, 503 阅读, 收藏,
摘要: WinAPI: SetWindowPos - 改变窗口的位置与状态//声明:SetWindowPos( hWnd: HWND; {窗口句柄} hWndInsertAfter: HWND; {窗口的 Z 顺序} X, Y: Integer; {位置} cx, cy: Integer; {大小} uFlags: UINT {选项}): BOOL;//hWndInsertAfter 参数可选值:HWND_TOP = 0; {在前面}HWND_BOTTOM = 1; {在后面}... 阅读全文

WPF设置窗体最前端显示

2012-09-13 13:25 by xchit, 4296 阅读, 收藏,
摘要: [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 h... 阅读全文