Jump to content
  • Advertisement
Sign in to follow this  
cNoob

How do I disable the maximize button

This topic is 4623 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 everyone thanks for taking some time to read my thread. I have been making my puzzle game for some time now and decided that I want it in window mode not fullscreen. So once I changed to window mode I relized I dont want the player to be able to resize the window or maximize it. So im trying to get the same window effect as minesweeper on windows. I found CS_NOCLOSE which disables the close button but cant find one which disables the maximize button. Any ideas. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
What is your "dwstyle" value for the CreateWindow(...) function. Its in that section that you decide whether or not to use those type of functions, like the maximize button.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There is no CS_* option to disable it. For most people, when beginning to program, they use the WS_OVERLAPPEDWINDOW style in CreateWindow. If you check the docs, this is a bitwise combination of different WS_* styles. One of them enables the maximize button. What you really want is to look up the WS_ styles for CreateWindow and just specify the ones you want, using the bitwise OR operator |

Share this post


Link to post
Share on other sites
At the moment im using WS_OVERLAPPEDWINDOW | WS_VISIBLE
I managed to disable the close button by putting CS_NOCLOSE in style from my WNDCLASSEX structure so im woundering if theres something like that for the maximize.

Share this post


Link to post
Share on other sites
Ok i have finally found what i was looking for. I know have a non resizeable window with just the close button. That should do the job nicely.

WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_VISIBLE

Thanks for the help guys.

Share this post


Link to post
Share on other sites
Been a little while since I touched Win32, but replacing "WS_OVERLAPPED" with "WS_MINIMIZE" should be fine.

Share this post


Link to post
Share on other sites
The reason the max button is there is because your using WS_OVERLAPPEDWINDOW. It's a combination of other WS_* 's. Lookup the window styles available and manually specifiy each one.

Share this post


Link to post
Share on other sites
Quote:
Original post by cNoob
At the moment im using WS_OVERLAPPEDWINDOW | WS_VISIBLE
I managed to disable the close button by putting CS_NOCLOSE in style from my WNDCLASSEX structure so im woundering if theres something like that for the maximize.


As the AP said, no, there isn't. Again as the AP said, if you look at the window styles docs WS_OVERLAPPEDWINDOW is the same thing as WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX. And finally as the AP said, you can simply omit |ing the flags you don't want, meaning removing the "| WS_MINIMIZEBOX".

Just replace WS_OVERLAPPEDWINDOW with WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX.

EDIT: Way too late :P

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!