Hi all.
I know there is a lot of mystery around the desktop context menu.
Plenty of brickerbrack about adding shell menu extensions, but not
much on shownig it. Using ShellContextMenu interfaces, it's easy to
show context menus for files and folders, but the explorer context
menu is elusive.
I can show it, but I'm wondering if someone could help me out with a
kink. It's easy to find the desktop HWND and post a right click
message to it if you can send a point where a file is not located.
Then the context menu is at the given position and it is not active.
Clicking an active item in the context menu works fine. Trying to
cancel the menu is more unusual. You need to click somewhere disabled
inside the menu to activate it and then click off.
Pseudo code, because I don't have access right now:
IntPtr desktopHWND = FindWindow("Progman", "Program Manager");
desktopHWND = FindWindowEx(ProgMan, 0, "whatever this was", null);
PostMessage(desktopHWND, <right click>, 0);
Can anybody help me out? There must be a way to find the window and
activate it programatically.
Thanks
BoeroBoy