Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI child window titlebar max/min/close buttons

Status
Not open for further replies.

MacGyverS2000

Programmer
Jun 27, 2004
12
US
Modifying an existing program...

The child window is a 2x10 frame with some pull-down menus at the top. I'm trying to get rid of the minimize, maximize, and close buttons at the top. The same buttons on the parent window should be the only ones available to the user.

The window is created with the following style:
[tt]cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_SYSMENU | FWS_ADDTOTITLE;[/tt]

The close and minimize buttons seem to have no effect. The maximize button initially comes up shown as maximized, with the first press partially shrinking the window as if it could overlap with others. Once partially shrunk, all of the buttons disappear.

I've searched for more styles, but nothing seems to be for turning off the buttons. I know WS_SYSMENU is needed to use the pull-down menus, but using it automatically adds in the buttons. Catch-22.
 
Would you prefer to get rid of the buttons or make them work correctly?

The correct functionality is:
1) the minimize button or menu item minimizes the MDI child in the lower left corner of the parent.
2) the maximize button or menu item fills the client area of the parent with the mdi child window.
3) the restore button or menu item sets the size of the mdi child to the size and location specified in the CreateWindow call or to the size and location it had before it was maximized or minimized, if the window has been moved around or resized.

I suspect you might be missing the MDI client, which is an invisible window the size of the client area of the parent. All MDI windows are children of the MDI client.

If you have access to the MSDN Library CDs, do a quick search on "MDI child" for an overview of the concept and an example.
 
Miros,

Thanks for the suggestions, but I decided to take another tack on this one... I'm rewriting it from scratch ;-)

Needless to say, the program now offers a LOT more functionality with a LOT less headaches.
 
Good luck! I've had to modify code like that...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top