Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » how to hide the title on the CMDIFrameWnd? Collapse All
Subject Author Date
wa haha Nov 2, 2005 - 9:03 PM

hi:
I want to hide the CMDIFrameWnd title to make the client’s space more bigger, and I want to move the title text just right of the file menu.. How can I do that??

Sample picture:
http://www.chaotex.com/cimmaker/11.bmp

regards
steve

Technical Support Nov 4, 2005 - 2:50 AM

Just create the main frame window without the WS_CAPTION style applied to suppress the caption. The menu bar should create a CExtBarButton-derived class instance as the first button that implements something like a caption.

wa haha Nov 8, 2005 - 8:45 PM

hi:


   I coding as what you said,, but the title bar is still showing up...  Am I wrong ??


   Following is my code , I use 2 methods to try it...


 


int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
  lpCreateStruct->style &= ~WS_CAPTION;
 if( CMDIFrameWnd::OnCreate(lpCreateStruct) == -1 )
 {
  ASSERT( FALSE );
  return -1;
 }


}


   OR.............


  
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 cs.style &= ~WS_CAPTION;
 if( !CMDIFrameWnd::PreCreateWindow(cs) )
  return FALSE;
 // TODO: Modify the Window class or styles here by modifying
 //  the CREATESTRUCT cs


 return TRUE;
}


 


 


regards


steve

Technical Support Nov 9, 2005 - 10:00 AM

To remove the caption from the MDI child frame is enough to remove the WS_CAPTION style. If you need to remove the caption from the main frame window remove the WS_OVERLAPPEDWINDOW style which is a combination of several styles:

#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED     |                              WS_CAPTION        |                              WS_SYSMENU        |                              WS_THICKFRAME     |                              WS_MINIMIZEBOX    |                              WS_MAXIMIZEBOX)

 
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;
 
 ModifyStyle( WS_OVERLAPPEDWINDOW, 0 );

....