HI Might it be easier to override the Toolbars OnClose so the Toolbar stays there but still has the close button.
Does the toolbar inherit this style from a parent window? Regards Max ----- Original Message ----- From: "Phil Daley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 22, 2004 6:41 PM Subject: [msvc] close button > I am having a problem in getting rid of (or disabling) the upper right > corner X (close button) in a CToolbar. > > I searched around and none of the suggestions I found work. > > myBar->ModifyStyle(WS_SYSMENU, 0, 0); > > That doesn't work, at the least because the toobar has no sysmenu. > > CWnd* pWnd = myBar->GetDockingFrame(); > pWnd->ModifyStyle(WS_SYSMENU, 0, 0); > > That removes the close button from the main application window. > > CWnd *pWnd = myBar->GetParent(); > pWnd->ModifyStyle(WS_SYSMENU, 0, 0); > > That also removes the close button from the main application window. > > One article talked about a CMiniDockFrame as being in charge of the > CToolbar and in control of the SYSMENU. > > But I cannot figure out how to get to it. > > Any ideas? > Phil Daley < AutoDesk > > http://www.conknet.com/~p_daley > > > > > > _______________________________________________ > msvc mailing list > [EMAIL PROTECTED] > See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive. > > _______________________________________________ msvc mailing list [EMAIL PROTECTED] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
