
Originally Posted by
bushmobile
if you find the ID of the menu you want to press then the SendMessage will just be a single line:
VB Code:
SendMessage thehWnd, WM_COMMAND, theID, 0&
If you want to send an Alt+P i guess you'll have to use WM_KEYDOWN and then WM_KEYUP - check out the virtual key constants of the keys too. Alt will be VK_ALT or something like that.
I've tried this to get the menu id with no success (nothing happens):
VB Code:
'...after shelling MyApp:
hWnd= FindWindow(vbNullString, "MyAppName")
hmnu = GetMenu(hWnd)
hsbmnu = GetSubMenu(hMenu, 0)
SendMessage hWnd, WM_COMMAND, hsbmnu, 0&
... I am sort of groping in the API...