11-12-2017, 07:01 PM
Try accessible objects. With some programs it works. Example with MS Word 2003:
Macro Macro2909
To create the first 2 lines of code, use dialog "Find accessible object". If you can find the MENUITEM, also look in Properties, it should have a default action, else probably will not work. If there are no MENUITEMs, this cannot be used with that window. I don't know other ways of executing menu items of inactive windows that don't support the 'men' function.
Macro Macro2909
int w=win("Document1 - Microsoft Word" "OpusApp")
Acc a.Find(w "MENUITEM" "Paste" "class=OpusApp" 0x1005)
a.DoDefaultAction
To create the first 2 lines of code, use dialog "Find accessible object". If you can find the MENUITEM, also look in Properties, it should have a default action, else probably will not work. If there are no MENUITEMs, this cannot be used with that window. I don't know other ways of executing menu items of inactive windows that don't support the 'men' function.