Capturing toolbar events inside a dialog class
I have a Dialog Resource in my resourceEditor & I have created a class out of it say "C_TestDialog",which is derived from CDialog.
I want to place a Toolbar control in this dialog. So I have added a "ToolBarcontrol" also in my resourceEditor.
Now If I take my ClassWizard,& select the "C_TestDialog" under class name.In the "ObjectIDs" section I see my classname & in the Messages column,I see all of the events,messages etc of this class.
Now What I need now is,How can I include my "toolbarcontrol" also inside the ObjectIDs section,under the className "C_TestDialog",so that I can see all the messages related to the toolbar control.
RightNow,If I select my toolBarcontrol(IDR_SelectToolBar) inside the ObjectIDs section,I see only 2 messages - "COMMAND" & "UPDATE_COMMAND_UI".
Iam creating my toolbar as follows:
//m_toolBarCtrl is the member varibale of type C_ToolBarCtrl--
which is a member of C_TestDialog class.
// Index of new button image.
tb.iBitmap = 0;
// Setting button state
tb.fsState = TBSTATE_ENABLED;
// Setting button style
tb.fsStyle = TBSTYLE_BUTTON;
tb.dwData = 0;
tb.iString = NULL;
Don't want to create a class derived from CToolBarCtrl.Want to access the Messages of the "toolbar" from my C_TestDialogClass.(For eg.- when the user clicks on the toolbar at runtime,I want this event to be trapped inside my C_TestDialog class)
Any Help is appreciated.