Advertisement

no maximize

Started by May 18, 2001 05:19 AM
1 comment, last by BlackHwk4 23 years, 8 months ago
Is there a WS_ command that lets you create a window with a minimize, maximize, and close button except that the maximize button is grayed out? I''ve seen programs that had windows like this but there''s not a command that does it in the help index of VC++ 6.0. Thanks for any help.
Yes, when you call "CreateWindow," give the third parameter these flags:

WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX

Here is an example:
   hwnd = CreateWindow(    szWinName, /* name of window class */    "MyProg",     WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, /* window style - normal */    2, /* X coordinate - let Windows decide */    2, /* Y coordinate - let Windows decide */    522, /* width - let Windows decide */    539, /* height - let Windows decide */    HWND_DESKTOP, /* no parent window */    NULL, /* no override of class menu */    hThisInst, /* handle of this instance of the program */    NULL   );  


Well, I hope that helps.

Later

James
Advertisement
Thanks it worked. I tried using just WS_OVERLAPPED and WS_MINIMIZEBOX but that didn''t work since now I know I had to use WS_CAPTION and WS_SYSMENU with it.

This topic is closed to new replies.

Advertisement