PDA

Click to See Complete Forum and Search --> : How do I access a toolbar?


abdul
Aug 8th, 2001, 07:35 PM
I have create a rebar control and a toolbar. The toolbar is a child window of rebar control.

I have just created and gotten the hwnd of the rebar control that creates the toolbar and sets toolbar as its child window itself. So I am unable to get the hwnd of the toolbar.
I want to change the state of the buttons on the toolbar at runtime. Do you know how to get the hwnd of toolbar if I have the hwnd of the rebar control?

Megatron
Aug 9th, 2001, 05:16 AM
What method are you using to create the toolbar? If you use CreateWindow() or CreateToolBarEx() both will return the handle to the toolbar.

Otherwise, I guess you could use the FindWindowEx function.

HWND hToolBar = FindWindowEx(hwndParent, 0, TOOLBARCLASSNAME, NULL);

abdul
Aug 9th, 2001, 06:48 AM
I am using CreateWindowEx but I using it in a function that creates the rebar control. Its mean that I can only call one function - rebar control function or toolbar control funcion - because if I call both, I will have one rebar control and a toolbar in the rabar control, and another toolbar.

I will FindwindowEx

Thanks