Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ironmax

How do I 'hide' the maximize/minimize/close buttons?

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

..well as the subject states, what is the syntax to disable those buttons, I want my window non-resizeable. I have searched the MSDN but haven''t succeded in finding a solution. Partially because I don''t know what to seearch for. I program in OpenGL through VC++ and glut.. Thanks in advance, this is my first post here so be easy on me.. aNilsson

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
If you want just the close button

WS_SYSMENU | WS_CAPTION | WS_VISIBLE

that''s will get you a normal window
with just the X. If you want to add
a minimize box logically OR the above
with

WS_MINIMIZEBOX

and you can do it once more for the
maximize box:

WS_MAXIMIZEBOX

It took me a while to find these styles,
so don''t feel dumb at all!

Share this post


Link to post
Share on other sites
Thanks alot!

I''m not sure how to implement this through glut though, but I''m going to try and experiment with this. Atleast I know what to look for now

Share this post


Link to post
Share on other sites
You pretty much can''t do it that way through GLUT.

Learn Win32 if you want to deviate from the basic GLUT interface. NeHe''s tuts cover the basics of setting up OpenGL under Win32.


-Brannon

Share this post


Link to post
Share on other sites
Ironmax, if you want your window non-resizeable you can also do this:

In your winproc:

  
switch(p_iMsg)
{

...

case WM_NCLBUTTONDOWN:
if(p_wParam == HTZOOM)
return 0;
break;


case WM_SYSCOMMAND:
if(p_wParam == SC_RESTORE && IsIconic(m_hWnd) == FALSE)
return 0;
break;

...
}


Then remove sizing border from your window.

  
DWORD l_dwStyle = GetWindowLong(g_hWnd, GWL_STYLE);

if(l_dwStyle & WS_THICKFRAME)
l_dwStyle = l_dwStyle ^ WS_THICKFRAME;

SetWindowLong(g_hWnd, (int) l_dwStyle);


You get this benefits:

MINIMIZE = ok.
MAXIMIZE = ok, if window are icon.
RESTORE = no (you don´t want that).
RESIZE = no.



Zeblar Nagrim, Lord of Chaos

Share this post


Link to post
Share on other sites

  • 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!