Click to See Complete Forum and Search --> : how can I change my main window's title


Danielle Harvey
April 10th, 1999, 07:54 AM
I have vc++6.0 and I created a SDI program called TextEdit. How can I change the title of the program shown in the blue title bar region of this SDI program?

Any response anyone can give me will be greatly appreciated.

ric
April 10th, 1999, 11:02 AM
Just add this code to your PreCreateWindow function:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) {

cs.style =~ FWS_ADDTOTITLE;
cs.name = "My title";

}

April 15th, 1999, 01:25 AM
If the title will always be the same, you can edit the string resource used to display the title. Click on the
"Resource" tab in theVC++ Workspace view. Expand the list of resource types, if necesary, then open the
string table (double-click it). Somewhere near the top (usually) you will find the title string. Click to edit the string,
then save your changes and re-compile.

April 15th, 1999, 01:49 AM
I think you missed an &

cs.style &= ~(LONG)FWS_ADDTOTITLE;