7.3. How do I make my CToolBar customizable at run-time?

Microsoft Visual C++/Microsoft Foundation Classes


7.3. How do I make my CToolBar customizable at run-time?

You might consider reading article "CToolBarCtrl :Handling Customization Notifications" in the Product Documentation of VC++ 2.1.

Here is the relevant extract :

"A Windows toolbar common control has built-in customization features, including a system-defined customization dialog box, which allow the user to insert, delete, or rearrange toolbar buttons. The application determines whether the customization features are available and controls the extent to which the user can customize the toolbar. These customization features are available in the CToolBarCtrl class but not in the current CToolBar class.

You can make these customization features available to the user by giving the toolbar the CCS_ADJUSTABLE style. The customization features allow the user to drag a button to a new position or to remove a button by dragging it off the toolbar. In addition, the user can double-click the toolbar to display the Customize Toolbar dialog box, which allows the user to add, delete, and rearrange toolbar buttons. The application can display the dialog box by using the Customize member function."

R.Rajendran (NetQuest), [email protected],

MSMFC Forum, May-9-95

If you want to make a standard MFC CToolBar customizable, you can download CUSBAR.ZIP from the MSMFC library on CompuServe. This package implements CCustomTolbar, the run-time customizable toolbar and also provides the necessary user tools (customization dialog box including the code for a bitmapped listbox). Freeware.

Patrick Philippot, 8/3/95 via email on CSERVE