Code to Dynamically Redock a Toolbar at Runtime

Wednesday Nov 1st 2000 by hdo hdo

Snippet that allows you to do such things as giving the end-user a "Reset all Toolbars" function

This is a simple code snippet that enables you to dyamically enable docking and then dock any toolbar at runtime. To use (or test) this code, simply add the following code to a COMMAND message handler such as OnChangeToolBar and the code will allow you to re-dock any undocked toolbars. Obviously, one way of implementing this would be to have a function that allows novice end-users that get happy with their mice to reset, or redock all toolbars at once. In that case, you could simply keep the toolbar ids in an array and iterate through them, redocking each one.
void CMainFrame::OnChangeToolBar() 
  AfxMessageBox("Error: could not load toolbar");

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved