Advertisement

Creating a toolbar

Started by February 25, 2001 06:06 AM
1 comment, last by Zeblar Nagrim 23 years, 11 months ago
Hey! I´m using Visual Studio 6.0 and want to create a toolbar to my win32 program. This is a big problem! For start the WNDCLASSEX structure dosn´t have toolbar class member (similar to the icon member hIcon). Then you can´t use CreateWindowEx, becuase there is no proper window object for a toolbar (only BUTTON, COMBOBOX, LISTBOX...). In the script resource editor in VC6.0 you can create a toolbar, but how the H*** are you going to connect it to the window? Please help me! Thanks, Zeblar Nagrim, Lord of Chaos
You use the CreateToolbarEx(lots of stuff here) function. And that''s all you need to do.

==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Advertisement
Yeah, in the CMainFrame::OnCreate() you do something like this:

  if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)){TRACE0("MainFrame Toolbar couldn''t be created\n");return -1;      // Error!}   


This is the code, VC++ 6.0 produces if you choose to have a standard toolbar in your project....
use the DockControlBar(); and m_wndToolBar.EnableDocking(); to control your toolbars...

ok, hope that helped,
cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )

This topic is closed to new replies.

Advertisement