-
I'd like to send ctrl-A to another program that isn't currently active. Ideally I'd like to trigger mouse events, key sequences on the other program. Basically I'd like to write a Macro program to interface with an already written program.
Anyone have any information on how to do this? I'm thinking I'd have to use the FindWindow API, but I'm lost after that...
Thanks,
Dim A
-
You can use AppActivate to active a program that is already running;
eg
Code:
AppActive "Notepad",True
If you catch an error from AppActivate it means the app is open, so you can then use Shell to open it, and then AppActivate it.
Once it is active you can use SendKeys to send keystrokes to it;
eg
Code:
Sendkeys "Hello",True 'sends Hello to the program
Sendkeys "^A",True 'sends CTRL+A to the program
See the SendKeys help for more info