Promote Your Blog
Google

Thursday, January 19, 2012

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;
}

No comments:

Post a Comment