Jump to content

ControlSend without a Control Name


kamyers1
 Share

Recommended Posts

I was doing some testing, using AutoItX to control Windows Notepad, when I happened to find that the follow unexpectedly worked:

set AutoIt=WScript.CreateObject("AutoItX3.Control")

AppWindowName="Untitled - Notepad"

AutoIt.ControlSend AppWindowName,"","","^o"

Can someone please explain exactly what this (using ControlSend without a control name) actually does? Does it send directly to the application window, or to the first child window of the application window, or something else?

The reason that I care is that I am looking hard for some way to send accelerator keystrokes to inactive windows. Since the windows are inactive, Send won't do the job, and I can't find the appropriate control to send accelerator keys to for some applications. So, if ControlSend without a control name is actually sending to the application window itself, or to some control that is set by default to receive keystrokes for the application, then using ControlSend in this manner *might* solve some of my problems. On the other hand, if this use of ControlSend is simply sending keystrokes to the *first* child control of the application window, then that most likely won't do me any good in general.

Thanks,

Kevin M.

Edited by kamyers1
Link to comment
Share on other sites

Right, but I think that I would appreciate a more definitive answer, from someone in the know if possible. By the way, I don't think that the two possibilities you mentioned are technically equivalent, are they? If not, then it could matter to users which one of these is really happening.

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...