kamyers1 Posted September 8, 2009 Share Posted September 8, 2009 (edited) 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 September 8, 2009 by kamyers1 Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 9, 2009 Share Posted September 9, 2009 It's very likely that it sends directly to the window, or to the control with focus. Link to comment Share on other sites More sharing options...
kamyers1 Posted September 9, 2009 Author Share Posted September 9, 2009 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 More sharing options...
Richard Robertson Posted September 9, 2009 Share Posted September 9, 2009 (edited) They aren't the same, no, but if you are firing an event that gets translated to an accelerator, it will end up being consumed by the window anyways, right? Keep in mind that the window itself rarely has focus. It's usually a control in the window that does. Edited September 9, 2009 by Richard Robertson Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now