Jump to content
  • Advertisement
Sign in to follow this  
dabo

[Win32] Application always on top problem

This topic is 3325 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!