Hi,
I have a really simple question. Can someone please give me some example code to send CTRL-S to a window. I can get the window handle, I just don't know how to send CTRL combos.
Thanks,
RIchard
Printable View
Hi,
I have a really simple question. Can someone please give me some example code to send CTRL-S to a window. I can get the window handle, I just don't know how to send CTRL combos.
Thanks,
RIchard
Use the SendKeys statement.
The Ctrl is represented by ^. Therefor, you can use the following method to send Ctrl+S
Code:AppActivate "MyApp"
SendKeys "^" + "V"
SendKeys( "^s" )
as I remember
Ha! I forgt to change the V to an S in my example :D. I was using Notepad to test my code and it doesn't have a Ctrl+S fnction so i changed it to V.
Use setforegroundwindow instead of using appactivate, as you may not know what youre app's caption is if it's changing, also another apps caption can interfere. And you said you got the handle, all you need is to pass it
Code:Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long