Bleed Posted December 28, 2008 Posted December 28, 2008 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.
TheCodeCracker Posted December 28, 2008 Posted December 28, 2008 You should set the windows extended style to WS_EX_TOPMOST
ragdog Posted December 28, 2008 Posted December 28, 2008 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,
0xFF Posted January 1, 2009 Posted January 1, 2009 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 .
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now