匯東網


win 32应用程序设置窗口保持最前端,顶置

[編輯] [转简体]
|
作者:huidong | 分類:【編程】Win32
[ 8 瀏覽 0 評論 2 贊 2 踩 ]

概要
win 32应用程序、MFC程序设置窗口保持最前端,顶置

正文


win32程序,有效:

SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

hwnd是你的程序的窗口句柄,在easyx中可以使用GetHWnd()得到


取消顶置做法:

SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

其实就是第二个参数中加了个NO



MFC里面:

this -> SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);//保持最前
this -> SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);//取消最前


[ 2] [ 2]


 評論區  0 條評論

+ 添加評論