Sign in to follow this  

[Win32] Application always on top problem

This topic is 3113 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm writing an editor using Win32 for my game but somehow it always stays on top. This is very annoying especially when debugging as I can't see Visual Studio because my editor is in the way. How do I disable this "always on top" behavior? I've checked the dialog properties but I can't find anything useful.

Share this post


Link to post
Share on other sites
Hello ,
I think the function SetWindowPos can remove that.
Chack out this article: http://www.codeproject.com/KB/cpp/KeepWindowAlwaysOnTop.aspx
And the MSDN reference: http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx


Raxvan.

Share this post


Link to post
Share on other sites
Try this:

::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

Any time after your window is created this should permanently turn off the "always on top" status... assuming, of course, that you don't have some other piece of code turning it back on [wink]

Share this post


Link to post
Share on other sites
Make sure that the dwExstyle parameter passed into CreateWindowEx doesn't have the WS_EX_APPWINDOW bit set, as this causes the window to appear on top of all windows unless hidden.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daggerbot
Make sure that the dwExstyle parameter passed into CreateWindowEx doesn't have the WS_EX_APPWINDOW bit set, as this causes the window to appear on top of all windows unless hidden.


WS_EX_APPWINDOW controls when a window is placed on the taskbar. You're thinking of WS_EX_TOPMOST.

(Reference)

Share this post


Link to post
Share on other sites

This topic is 3113 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this