I try use SetWindowPos,But someone told me it was wrong to do that.
WIN32 program , How to top window in WIN8/WIN10 ? like the Task Manager。
I try use SetWindowPos,But someone told me it was wrong to do that.
WIN32 program , How to top window in WIN8/WIN10 ? like the Task Manager。
Two ways to make a window "top most".
When you create the window with CreateWindowEx, specify WS_EX_TOPMOST
as an extended style.
CreateWindowEx(WS_EX_TOPMOST, ...);
For an existing window, use SetWindowPos:
DWORD flags = SWP_NOMOVE | SWP_NOSIZE;
SetWindowPos(hwnd, HWND_TOPMOST, 0,0,0,0, flags);
Either way is fine.