Jump to content

Send Keys/commands to window that is not active


Recommended Posts

Is there a way to send keystrokes to an application that has not been brought to the forefront using WinActivate or some other command?

I have anywhere from 2->12 applications open at the same time and need to send keystrokes and mouse commands to them on a regular basis when an event occurs.  When I do the winactive it takes about 2.5 seconds to make each application active (older computer). So was hoping to see if there was a way to send stuff to it while it is in background/minimized?

 

Thanks in advance

Link to comment
Share on other sites

  • Moderators

You would want to look at the Control commands, such as ControlSend. Once you target the window, you can send commands to it whether it is active or not. Check out ControlSend in the help file for a pretty good example on usage.

You'll need to use the AutoIt Window Info tool (in the same directory where you installed AutoIt) to find the contents of the window, and then you can use the control commands to send commands directly to the window.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...