Hi, how can I prevent a window from being maximized or gray out the maximize button? If you need my code it is just the basic window from winprog.org.
Printable View
Hi, how can I prevent a window from being maximized or gray out the maximize button? If you need my code it is just the basic window from winprog.org.
I think this will prevent the maximizing of a window (not tested):
Code:HMENU m = GetSystemMenu(hWnd, FALSE)
RemoveMenu m, SC_MAXIMIZE, MF_BYCOMMAND
Well, that sort of works. The maximize button is clickable, but nothing happens when you click it. You can still resize the window by dragging, however.
In You CreateWindowEx Procedure, simply use the following in your dWstyle.
this creates a window that cannot be sized and a window that does not have its maximize button enabled.Code:WS_OVERLAPPEDWINDOW - WS_MAXIMIZEBOX - WS_SIZEBOX
AAG, thanks a lot! That works perfectly.
No Problem. :) Glad To Help