Reputation: 90475
When you click the right mouse button on your clean desktop it opens a context menu. Each item there is a call to a method. To programmatically call those methods, first I need to know which one I want. IIRC there is a tool that helps with that, but I can't remember its name.
Upvotes: 0
Views: 276
Reputation: 11
Use Spy++ to find the handle and use SendMessage / PostMessage. It will be something similar to:
hwnd = FindWindow(...)
hmenu = GetMenu(hwnd)
hsubmenu = GetSubMenu(hmenu, 0)
menuid = GetMenuItem(hsubmenu, 1)
SendMessage(hwnd, WM_COMMAND, menuid, 0)
Upvotes: 1
Reputation: 941635
You cannot call such a method in another process. You could try to inject the WM_COMMAND message that a context menu usually generates with SendMessage. Use Spy++ to find out what that message might be, if it exists.
Upvotes: 2