Ruslannnn

How can I send a key to inactive window?

5 posts in this topic

Hello, I have a Veeam backup software, and want to Send key "b" to Veeam window when Windows is locked.

I cannot use Send() because Veeam windows cannot be active when Windows is locked.

I tried to use ControlSend() :

$VeeamWindowsTitle = "Veeam Endpoint Control Panel"
$VeeamDir = "C:\Program Files\Veeam\Endpoint Backup\"

$PID = Run($VeeamDir & "Veeam.EndPoint.Tray.exe", $VeeamDir, @SW_MAXIMIZE)
Sleep(3000)
ControlSend($VeeamWindowsTitle,"","","b")

but it works only when Veeam window is active.

How can I send key to Veeam window without selecting any control?

Share this post


Link to post
Share on other sites



What does the AutoIt Window Info Tool (in the same directory where you installed AutoIt) show when you hover over the Veeam window? The third parameter is the ControlID of the control you want to end the text to.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
3 hours ago, JLogan3o13 said:

What does the AutoIt Window Info Tool (in the same directory where you installed AutoIt) show when you hover over the Veeam window? The third parameter is the ControlID of the control you want to end the text to.

Thank you for help... But I tried with this tool, but it shows no control in Veeam windows, it gets only handle of whole Veeam window. But this tool shows name of controls in, e.g., Calculator or Notepad.

 And I tried to get control names/handle/class with different scripts that I found in AutoIt forums - same result (in Veeam they show only windows handle, in Calculator/Notepad - show control handle and class).

Veeam window has "Backup" button. Without AutoIt, if I activate this window and press "b" - backup process starts.

If I use WinActivate and Send when Windows is not locked - it works:

$VeeamWindowsTitle = "Veeam Endpoint Control Panel"
$VeeamDir = "C:\Program Files\Veeam\Endpoint Backup\"

$PID = Run($VeeamDir & "Veeam.EndPoint.Tray.exe", $VeeamDir, @SW_MAXIMIZE)
WinActivate($VeeamWindowsTitle)
Send("b")

But I want to run this exe late night, when windows is locked, and can not use WinActivate function =(

Maybe I am doing something wrong? Maybe there is a another way? Thanks!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm not sure you can do it without the window being active, since as of some early AutoIt3 version ControlSend requires a ControlID for it to function correctly. So unless you can get a ControlID from the window I'm not sure how else you would be able to send input while the computer is locked. If you can even get the ID of the window it might be enough to ControlSend($VeeamWindowsTitle, "", $windowID, "b").

Edited by anthonyjr2

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

Take a look at the IUIAutomation thread in the Examples forum. That is usually the go-to for anything that cannot be manipulated with the Control commands.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now