Tech Support > Microsoft Windows > Development Resources > Windows Explorer - Toolbar Modifications
Windows Explorer - Toolbar Modifications
Posted by Damjan Vengušt on December 29th, 2003


Hey!

I would like to do some modifications to Windows Explorer Menu (e.g. Add
another menuitem after Help,...). I guess this must work for any visible
window.

I am using Visual C++ 6.0.


So far I have this:
Find handler to Explorer's Toolbar (ToolbarWindow32)

HWND hWin = ::FindWindow("ExploreWClass", NULL);
HWND hWorker = ::FindWindowEx(hWin, NULL, "WorkerW", NULL);
HWND hReBar = ::FindWindowEx(hWorker, NULL, "ReBarWindow32", NULL);
HWND hTBar = ::FindWindowEx(hReBar, NULL, "ToolbarWindow32", NULL);

while ReBar has 3 ToolbarWindow32 childs, we have to find "Menubar"

This is my frst problem: How to identify the "MenuBar"?
My "sollution" ( I know this is very very BAD, but...):
while ( hTBar != (HWND)0x001801A0 ) // number taken from Spy++
{
// Search for "MenuBar" handler
hTBar = ::FindWindowEx(hReBar, hTBar, "ToolbarWindow32", NULL);
}

(hTBar is now a handler of explorer's "MenuBar".

This works
::ShowWindow(hTBar, SW_HIDE);
so I guess I have found the right handler.
(It hides menubar from specific explorer window, but I still dont know
how to do some modification.)

And I also know how to SHOW/HIDE the whole "ReBar"


My second problem is:
How can I make any Modifications? (Add ManuItem, Change label of
existing menuitem,...)

I guess I must link (Attach) handler to MFC class representing the right
win32 class.

I tried to use CReBar for hReBar handler, CToolBar and CToolBarCtrl for
hTBar handler but also didn't work. I guess I am missing something, but
cannot figure it out what.


Any Ideas

Thanks
Damjan



Similar Posts