Posted December 28, 200816 yr Hi, I'm coding on some win32 c++ app. What API should I use to keep the window on top of other windows regardless if it is selected or not? I'm just guessing it is an API, but I'm not sure if it is one.
December 28, 200816 yr Hi here is a masm example invoke IsDlgButtonChecked,hWnd,IDC_ALWAYSONTOP .if eax==BST_CHECKED mov eax,HWND_TOPMOST .else mov eax,HWND_NOTOPMOST .endif invoke SetWindowPos,hWnd,eax,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE I think this is not difficult to translate in c++greets,
January 1, 200916 yr Use SetWindowLong (Ptr if you want it to support x64) or just SetWindowPos() get the Window handle (hWnd) and use SetWindowPos on it, with IDC_ALWAYSONTOP or WS_EX_TOPMOST .
Create an account or sign in to comment