How do remove 'Untitled' in main window caption
· One min read
To remove 'Untitled' in main window caption
- Override the PreCreateWindow() function in CMainFrame class
- Modify the CREATESTRUCT style by adding the below code cs.style &= ~FWS_ADDTOTITLE ;
Code snippet:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
////////////////////////////////////////////////////////////////////////////
// To remove 'Untitled' in main window caption //
////////////////////////////////////////////////////////////////////////////
cs.style &= ~FWS\_ADDTOTITLE ;
////////////////////////////////////////////////////////////////////////////
return TRUE;
}