Wednesday, October 24, 2007

Changing the caption of a floating toolbar

Before we go through the code we just need to know the window layout of a floating toolbar.
Here it is:
CToolbar
CDockBar
CMiniDockFrameWnd

Suppose, we have a toolbar pointer pToolBar. Here is the code to change its caption.

pToolBar->SetWindowText(szToolBarName);
CMiniDockFrameWnd *pParentFrame;

pParentFrame = DYNAMIC_DOWNCAST(CMiniDockFrameWnd,
pToolBar->GetParentFrame));
if(pParentFrame != NULL)
{
pParentFrame->m_wndDockBar.SetWindowText(szToolBarName);
pParentFrame->SetWindowText(szToolBarName);
}

No comments: