SetWindowPos的作用:
在MSDN里面是这样表述的:The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order。
BOOL SetWindowPos(
HWND hWnd,
HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);它可以设置对话框的位置大小和显示模式,也可以设置显示的层次如Z轴的最顶层,例如:
::SetWindowPos(AfxGetApp()->m_pMainWnd->m_hWnd,IsDlgButtonChecked(IDC_CHECK1)?HWND_TOPMOST:HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
HWND_TOPMOST设置显示位置是最顶层,也就是最外层,这看上去有点类似,对话框里的非模态对话框
本文介绍了Windows API中的SetWindowPos函数,详细解释了如何使用该函数调整窗口的位置、大小及显示层级,并提供了示例代码。

943

被折叠的 条评论
为什么被折叠?



