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
设置显示位置是最顶层,也就是最外层,这看上去有点类似,对话框里的非模态对话框