Jump to content

ControlSend + InactiveWindow + VBScript = Fail

Recommended Posts


I have probably the simplest VBScript on the planet created, yet it's not working and I am not sure why.  I have a need to send a simple key combination to an inactive window but it only works if the window is ACTIVE.  If I change the title to something else, it no longer works, so I know it's not a problem with matching the title of the window.  It seems to be something else.  Here is world's simplest script:

Set oAutoIt = CreateObject("AutoItX3.Control") 
oAutoIt.AutoItSetOption WinTitleMatchMode, 2
oAutoIt.ControlSend "Notepad", "", "", "123"

If I make Notepad Active and run it,  it works.  If I minimize notepad,  it no longer works.  What gives?

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.