[c++] always on top source code
Thursday, 23. July 2009, 19:58:18
Ok, because many people come here searching probably the source code - solution, how to set up window always on top, i'm posting the two lines of the code.. from my app that you can find in previous posts...
Read belowe to find more...
Read belowe to find more...
Ok,
to set up the windows always on top you need to use one winapi function: SetWindowPos, with of course, required parameters, and so.
To set it always on top use this:
SetWindowPos(myHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE)
Where:
myHandle - is window HWND - handle to the window we want to set up...
HWND_TOPMOST - place the window in the TOPMOST state...
the zeors are the new size and position of the window (we don't want to change it, but only set it on top)
SWP_NOMOVE - will not move the window
SWP_NOSIZE - will not resize the window after change...
and that's all,
if you want to unset the window just call the function again:
SetWindowPos(myHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
and i think this is all you need to set/unset the window always on top
If you have any other questions, leave a comment and i'll try to help you if i have some time...













How to use Quote function: