2

Is it possible to make this script work in a specific inactive/minimized window. ?

loop    
{  
dllcall("keybd_event", int, VK, int, SC, int, 0, int, 0)  
dllcall("keybd_event", int, VK, int, SC, int, 2, int, 0)  
}  
Pause::Pause
1
0

You can use ControlSend. You should not have to send a separate 'up' command although you can put that in there if you want. The keys will be sent even if the window is minimized or inactive.

Note that this is not a check on whether that happens to be the case or not, it just tries to send either way.

myWinTitle:="ahk_exe iexplore.exe" ; pick a window title or program
Loop {
    ControlSend,,^{vk43sc02E}, %myWinTitle%  ; send Ctrl+C
    Sleep 100
}
pause::pause

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.