Hello,
Ive created a floating tool bar with a single drop down button and some sub items. How do I go about adding a bitmap to each of the sub items, as well as a checked field. Im guessing I need to use the windows APIs?
Im having a bit of a hard time getting started with it, does any one have any examples on it?
I think he has used Windows Common Controls Toolbar (SP6).
The button menu is a 'normal' menu. When you click the buttongroup, the oolbar sends a WM_INITMENUPOPUP message.
If you subclass the toolbar, you can get hwnd of the popup menu from WM_INITMENUPOPUP message. Then you can modify the menuitems as you like.
here (post#18 onwards) are examples of similar code for external applications. Those codes uses 'Hooking', but as the toolbar is in your own application, it will be a LOT easier in your case. You can do what you want by using 'normal subclassing'.
Thanks, but when I try to use either GetSubMenu(Toolbar1.hwnd, 0), or getmenu(Toolbar1.hwnd), I get 0. Am I supposed to be using a different API call? Or am I passing the wrong argument?
Here is a sample code that adds bitmaps in a ButtonMenu.
For the CheckedMenu, I couldn't manage to find any way to successfully set MF_CHECKED.
So, I'm using a boolean variable and a checkmark bitmap to track checked status.