how to add Toolbar into menubar created by SHCreateMenuBar?
Hi all experts,
After create menubar by SHCreateMenuBar, i want to add Toolbar beside the menu in
menubar? It's very easy and clair in evc++ 4.0 but in visual studio 2005 it's so stupid cos i
spent a lot of time but i couldn't find out.
Thank for your instruction.
[287 byte] By [
JulienT] at [2008-2-26]
Hi,
First, thank for your viewing.
In fact, i don't find any way to add Toolbar beside the menu in menubar created by
SHCreateMenuBar.
But i will introduce another way to add menu and toolbar in visual studio 2005 with
SHCreateMenuBar.
To do that you have initialize your varibale ( which is SHMENUBARINFO ) before
pass it to SHCreateMenuBar. Make attetion in nToolBarId of SHMENUBARINFO.
To display menu and toolbar you have to make a custom resource by yourself.
If you need more information, feel freely to contact to me.
I have to do this cos in visual studio 2005, a lot of class in MFC we're using in evc++ 4.0 is removed, i don't know why.
Hi, I am trying to add Toolbar beside the menu created by SHCreateMenuBar in ECV++ 4.0, how do I do? I can't get the pictures in the bar!
Thanks in advance
I'm migrating my PPC2003 to Visual Studio 2005, and I have a problem with CCommandBar. My old code used CCeCommandBar.InsertToolBar() and CCeCommandBar.InsertMenuBar() to initialize the commanbar, and then later I would change the menubar and toolbar by calling InsertToolBar() and InsertMenuBar with other resourses. I do not manage to get the same functionality with CCommandBar. Is it done in another way? If so, does anyone know how?
I also append a menu to the menubar in my old program, this also does not work in Visual Studio 2005. I do this with GetMenu() and CreatePopupMenu() and append the new popup menu. But after migrating the appended menu does not show up. DrawMenuBar() does not help.
This is important functionality in my program, so I would very much appreciate some help on this.
Hi Julien
As hinted in your post, I am creating a variable (initialized) SHMENUBARINFO, but I am still not able to get the toolbar in my window. Below is the code I have created.....
SHMENUBARINFO mbi = {0};
// We need to create the menubar window mbi.cbSize =
sizeof(SHMENUBARINFO); mbi.dwFlags = 0;
mbi.hwndParent = hWnd;
mbi.nToolBarId = IDR_TOOLBAR1;
mbi.nBmpId = IDB_BITMAP1;
mbi.cBmpImages = 1;
mbi.hInstRes = GetModuleHandle(_T(
"My_Module.dll")); SHCreateMenuBar(&mbi);
Seeking your help!!