Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 13th, 2004, 01:35 AM
Authorized User
Join Date: Jul 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Capturing toolbar events inside a dialog class

Hi Guys,

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:

CRect toolbarSize(20,20,300,50);
//m_toolBarCtrl is the member varibale of type C_ToolBarCtrl--
which is a member of C_TestDialog class.

m_toolBarCtrl.Create(WS_CHILD|TBSTYLE_FLAT,toolbar Size,this,IDR_SelectToolBar);



// Index of new button image.
tb[0].iBitmap = 0;
// Setting button state
tb[0].fsState = TBSTATE_ENABLED;
// Setting button style
tb[0].fsStyle = TBSTYLE_BUTTON;
tb[0].dwData = 0;
tb[0].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.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events for Control Inside DetailsView AspNetGuy ASP.NET 3.5 Basics 3 June 6th, 2008 02:09 PM
capturing high priority events of windows rinks Pro VB 6 0 March 16th, 2005 04:57 AM
capturing form closed events alexferrie C# 2 June 17th, 2003 10:53 AM
Dialog Class pic_az Java GUI 4 June 5th, 2003 03:34 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.