2024年3月24日发(作者:)

SetWindowPos(

(GetExStyle() & WS_EX_TOPMOST) ? &CWnd::wndNoTopMost : &

CWnd::wndTopMost,

0,0,0,0,

SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

SetWindowPos(&wndTopMost,0,0,0,0,SWP_xxxx);

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

BOOL SetWindowPos (

const CWnd* pWndInsertAfter,

int x,

int y,

int cx,

int cy,

UINT nFlags );

将第一个参数设置为HWND_TOPMOST就行了。

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

取消最上面显示:

::SetWindowPos (this->m_hWnd,

HWND_NOTOPMOST,

0,

0,

0,

0,

SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

取消最上面显示: