PRB: Cannot Remove Minimize or Maximize Button from Caption Bar

ID: Q130760

The information in this article applies to:

SYMPTOMS

Applications cannot create an overlapped or a popup window that contains only the Minimize or the Maximize button.

CAUSE

This is by design. Windows can have both buttons or none depending on the styles specified while creating the window, but specifying just one style (either the WS_MAXIMZIEBOX or WS_MINIMIZEBOX) creates both buttons on the caption, with the other one disabled.

STATUS

This behavior is by design.

MORE INFORMATION

Under Windows version 3.1 or Window NT 3.51 and earlier, applications could remove either the Maximize or Minimize buttons on the caption bar. (This was usually done when the appliction removed a corresponding menu item from the system menu of a window.)

Applications running under Windows 95, Windows 98, and Windows NT version 4.0 and later that try to remove one of the buttons (not both), will not succeed. The system displays both buttons and disable the one whose style was not specified during creation. This is by design, and there is no way to work around it, unless the application draws its own caption bar.

Applications that removed the maximize or minimize menu items under Windows version 3.1, should just gray them out (disable them) under Windows 95, Windows 98, or Windows NT version 4.0 and later to maintain a uniform user interface.

Under Windows 95, Windows 98, and Windows NT version 4.0 and later, applications can create a window (overlapped or popup) with just the Close button (the X button) by creating the window without specifying the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. Calling SetWindowLong(GWL_STYLE) to change or remove the minimize of the maxmize buttons dynamically still displays both buttons with one of them disabled.

Additional query words:

Keywords          : kbNTOS400 kbGrpUser kbWinOS95 kbWinOS98 kbWndw kbWndwProp 
Issue type        : kbprb

Last Reviewed: January 2, 1999