Ad Code

Responsive Advertisement

How To Display Window Title in SDI/MDI application

1. Most VC++ programmers forget to add following red colored line to PreCreateWindow function in MainFrm.cpp of your SDI/MDI application.

2. Calling SetWindowText alone for title will not work until this line is added

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~FWS_ADDTOTITLE;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}

Post a Comment

0 Comments