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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Close Icon From System Menu

Status
Not open for further replies.

BrotherC

Programmer
Sep 29, 2002
25
0
0
CA

Hi,

In my MDI app I would like to remove the close button from the system menu in all my view frames and just have the maximize and minimize button. Can't seem to do it. I can disable the close button using CMenu but I would like it removed.

Is this possible? I noticed in the CDialog properties it will not allow you to select minimize or maximize options unless system menu is selected. Maybe that's the case with CMDIChildWnd?

Here's what I've tried for flags:

BOOL CChildFrame::preCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWnd::preCreateWindow(cs) )
return FALSE;

cs.style = WS_CHILD | WS_VISIBLE | WS_CAPTION |
WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME;
return TRUE;
}

Let me know if you can help me out.

Thanks,

Brother C
 
Try Following :

BOOL CChildFrame::preCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style &= !WS_SYSMENU ;
cs.style |= WS_CAPTION ;
cs.style |= WS_CHILD;
if( !CMDIChildWnd::preCreateWindow(cs) )
return FALSE;

return TRUE;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top