Click to See Complete Forum and Search --> : How to change the title of SDI project


Shahzad
April 9th, 1999, 12:40 AM
Please tell me how can we change the title of an SDI project which is by default 'untitled..'

ric
April 9th, 1999, 04:10 AM
Just redefine the PreCreateWindow function of the CMainFrame class like this:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

cs.style = WS_OVERLAPPEDWINDOW;
cs.lpszName = "My ****ing Title";

return CFrameWnd::PreCreateWindow(cs);
}

LALeonard
April 9th, 1999, 09:52 AM
If all you want to do is get rid of that ugly "Untitled - " part, and leave the name of your app behind, do this:

// Comment out FWS_ADDTOTITLE to get rid of "Untitled - MyApp" on the title bar.
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~ FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
}


LA Leonard - Definitive Solutions, Inc.