OLDBARS: Support for Old-Style CToolBar and CStatusBar

Starting with Visual C++® version 4.0, the CToolBar and CStatusBar classes use common controls built into Windows® 95 and Windows® NT 3.51.

The OLDBARS sample provides support for applications that rely on the old implementations of CToolBar and CStatusBar by providing the source code for these classes. The sample demonstrates how to use these classes, renamed COldToolBar and COldStatusBar, to maintain backward compatibility.

To use these classes in your own programs, rename them in your own source code to COldToolBar and COldStatusBar, then copy the following files to your project directory and add them to your project:

  • GLOBALS.H — declarations of global data for system metrics.

  • GLOBALS.CPP — definitions of global data for system metrics.

  • STATBAR.H — declaration of the COldStatusBar class.

  • STATBAR.CPP — definition of the COldStatusBar class.

  • TOOLBAR.H — declaration of the COldToolBar class

  • TOOLBAR.CPP — definition of the COldToolBar class.

This sample demonstrates the following keywords:

AfxIsValidAddress; AfxRegisterWndClass; AfxThrowResourceException; BitBlt; CCmdUI::Enable; CCmdUI::SetCheck; CCmdUI::SetText; CDC::GetTextExtent; CDC::GetTextMetrics; CDC::RectVisible; CDC::SelectObject; CDialog::DoModal; CDocument::OnNewDocument; CDumpContext::GetDepth; CFrameWnd::Create; CFrameWnd::DockControlBar; CFrameWnd::EnableDocking; CFrameWnd::LoadFrame; CObject::AssertValid; CObject::Dump; CObject::Serialize; CRect::Height; CRect::InflateRect; CRect::OffsetRect; CRect::PtInRect; CRect::SetRectEmpty; CRect::Width; CStatusBar::CStatusBar; CStatusBar::CommandToIndex; CStatusBar::Create; CStatusBar::GetItemID; CStatusBar::GetItemRect; CStatusBar::GetPaneInfo; CStatusBar::GetPaneText; CStatusBar::SetIndicators; CStatusBar::SetPaneInfo; CStatusBar::SetPaneText; CString::GetLength; CString::LoadString; CToolBar::CToolBar; CToolBar::CommandToIndex; CToolBar::Create; CToolBar::GetButtonInfo; CToolBar::GetItemID; CToolBar::GetItemRect; CToolBar::LoadBitmap; CToolBar::SetButtonInfo; CToolBar::SetButtons; CToolBar::SetHeight; CToolBar::SetSizes; CView::DoPreparePrinting; CView::GetDocument; CView::OnBeginPrinting; CView::OnDraw; CView::OnEndPrinting; CView::OnPreparePrinting; CWinApp::AddDocTemplate; CWinApp::Enable3dControls; CWinApp::InitInstance; CWinApp::LoadStdProfileSettings; CWinApp::OnFileNew; CWnd::DoDataExchange; CWnd::GetCapture; CWnd::GetClientRect; CWnd::GetOwner; CWnd::GetParentFrame; CWnd::GetStyle; CWnd::Invalidate; CWnd::InvalidateRect; CWnd::IsZoomed; CWnd::OnCancelMode; CWnd::OnCreate; CWnd::OnLButtonUp; CWnd::OnMouseMove; CWnd::OnSize; CWnd::OnSysColorChange; CWnd::OnSysCommand; CWnd::OnWinIniChange; CWnd::PreCreateWindow; CWnd::SendMessage; CWnd::ShowWindow; CWnd::UpdateDialogControls; CWnd::UpdateWindow; ClientToScreen; CreateBitmap; CreateCompatibleBitmap; CreateCompatibleDC; CreateDIBitmap; CreateFontIndirect; CreatePatternBrush; CreatePen; CreateSolidBrush; DeleteDC; DeleteObject; DragAcceptFiles; ExtTextOut; FindResource; FreeResource; GetBValue; GetClientRect; GetDC; GetDeviceCaps; GetGValue; GetObjectType; GetRValue; GetStockObject; GetSysColor; GetSystemMetrics; GetVersion; HIBYTE; HIWORD; InvertRect; LOBYTE; LOWORD; LineTo; LoadBitmap; LoadCursor; LoadResource; LockResource; MAKEINTRESOURCE; MoveTo; MulDiv; OffsetRect; PatBlt; RGB; RectVisible; ReleaseCapture; ReleaseDC; SelectObject; SendMessage; SetBkColor; SetBkMode; SetCapture; SetROP2; SetRect; SetTextAlign; SetTextColor; StretchDIBits; UpdateWindow; free; lstrcmp; lstrcpy; lstrlen; malloc; memcpy; memset; min