
Changing text in title bar
I am trying to change the default text generated by Visual C++
AppWizard, after the fact, with the following modifications to the
listed member function. Changing all the other attributes of the
structure CREATESTRUCT work just fine. However, there is no take on the
name change when the pointer cs.lpszName is directed to point to a new
string defined on the previous line.
Is there a way in the code to set the Title Bar text? If so, can you
point me in the right direction? Thanks.
= = =
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
// Keep all the current style features
// except border should NOT be resizeable
cs.style &= ~WS_THICKFRAME;
// Set Calendar to be centered in the window
// and sized to 1/4 screen height and 1/2 the screen width
cs.cx = ::GetSystemMetrics(SM_CXSCREEN) / 2;
cs.cy = ::GetSystemMetrics(SM_CYSCREEN) / 4;
cs.x = (::GetSystemMetrics(SM_CXSCREEN) - cs.cx) / 2;
cs.y = (::GetSystemMetrics(SM_CYSCREEN) - cs.cy) / 3;
// Set name in title block
char Name[] = "New Name";
cs.lpszName = Name;
return CFrameWnd::PreCreateWindow(cs);
Quote:
}
--
Best regards, Tom
***********************************************************************
"We crucify ourselves between two thieves: regret for yesterday
and fear of tomorrow."
-- Fulton Oursler, American journalist and author (1893-1952)
***********************************************************************