[RESOLVED] External program access
Is it possible to simulate menu and button clicks or keypresses (eg. Ctrl+S) in an external program?
I'm able to get the hwd of the external progam in question and have set foucs to it using the FindWindow and SetForegroundWindow API's but not sure where to start for the clicks/keypresses. Would appreciate any pointers :thumb:
EDIT: Have worked on this some more. I've used the GetMenu API to attempt to get the handle to the external app's menu but have run into a snag...the menus are all located on a toolbar so when I run the GetMenu API it always returns 0. I've read other posts with ppl using Spy++ to get Window handles and have used it to find the toolbar handle of the external app but now i'm stuck on getting the menu handle from the toolbar.
Hope this makes sence :confused:
Thanks.
1 Attachment(s)
Re: External program access
there are many ways to send automated keystrokes, mouse clicks, and such to applications.
most beginners use the vb command SendKeys() to send keystrokes. you should search for Sendkeys and find out how it works if you like.
also for menu's, you can use api to find the Menu item Name, if you dont know the index and/or subindex of the menuitem, then you can click it via programming as well.
i zipped up something i was working on a while back for menu api its not nearly finished but its pretty decent. for this sample, i added another module to it that simulates keypresses and mouseclicks as well. maybe you can use something from this.
Re: External program access
Thanks Billy, I've changed from API's to SendKeys which is working well as I've setup a bunch of Keyboard shortcuts in the external app and so far so good :thumb: