Jump to content
  • Advertisement
Sign in to follow this  
Renthalkx97

Win32 Borderless Fullscreen Window

This topic is 895 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

Hey all. I want to have a borderless fullscreen window that show's the title bar (ONLY the title bar, no other borders), when the user mouses to the top-right of the window. I will have no trouble implementing the last part, but I cannot figure out a combination of Window Styles to achieve only showing the title bar and no other borders. My results are either all borders showing or no borders showing.

 

Thank you in advance,

BagelBytes.

Share this post


Link to post
Share on other sites
Advertisement

That unfortunately doesn't work directly. WS_CAPTION includes WS_BORDER automatically.

 

You could either accept the border, but move if off screen (place the window at negative coordinates, so that the caption and client area cover the screen).

 

Or, manually draw the caption in the client are.

Share this post


Link to post
Share on other sites

That unfortunately doesn't work directly. WS_CAPTION includes WS_BORDER automatically.

 

You could either accept the border, but move if off screen (place the window at negative coordinates, so that the caption and client area cover the screen).

 

Or, manually draw the caption in the client are.

 

I figured that WS_CAPTION ^ WS_BORDER would remedy the issue but that just removes the entire border, title bar included.  What would you personally recommend for doing what I want out of the two options you gave?

Share this post


Link to post
Share on other sites

I figured it out. What I ended up doing was creating a child window and positioning it at <0, 0>,  dimensions <width, 0>, and just hiding it until the mouse is in trigger area.

Share this post


Link to post
Share on other sites

hm, WM_POPUP doens't have border?

 

No. Well it's irrelevant - in Windows, a window can not natively have a caption bar without having borders. Well, not trivially at least. You would have to handle WM_NCHITTEST and WM_NCPAINT and other related messages to create your own user-defined caption area, but really, I don't see the point. When a window is maximized, Windows will hide its borders anyway.

Edited by Amr0

Share this post


Link to post
Share on other sites


When a window is maximized, Windows will hide its borders anyway.

 

Yes, but if you need to minimize/exit, the title bar appears when you hover your mouse near it. I have that working, I just need to figure out how to make it non-movable. I guess I handle WM_SYSCOMMAND for that.

Share this post


Link to post
Share on other sites
Most games that do this kind of thing just don't use the titlebar at all and draw their own minimize/maximize/close buttons using their existing UI code. You can even detect when the game isn't fullscreen/fullscreen windowed and not draw those buttons in that case, letting the user use the actual window buttons in the visible titlebar.

Saves a lot of headache smile.png

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!