Anaken Posted November 10, 2007 Share Posted November 10, 2007 The Send() function sends simulated keystrokes to the ACTIVE window. How to send simulated keystrokes to the INACTIVE window by hwnd ? Link to comment Share on other sites More sharing options...
BrettF Posted November 10, 2007 Share Posted November 10, 2007 The Send() function sends simulated keystrokes to the ACTIVE window.How to send simulated keystrokes to the INACTIVE window by hwnd ?ControlSend? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Anaken Posted November 10, 2007 Author Share Posted November 10, 2007 I tried to use it, but it didnt work. #include <misc.au3> _Main() Func _Main() $hwnd = WinGetHandle("Mozilla Firefox") MsgBox(0,"Info", "Window handle is : " & $hwnd) $key = "^t" SendMyKey($hWnd, $key) EndFunc Func SendMyKey ($hwnd, $key) ControlSend($hwnd, "", "", $key) If @error Then MsgBox(0,"Error", "Error has occurred : " & @error) Exit EndIf EndFunc Link to comment Share on other sites More sharing options...
BrettF Posted November 10, 2007 Share Posted November 10, 2007 I am unsure of the usage with windows. The helpfile states:ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active windowSo I am assuming it works on windows. Also do a search (up in the top right corner) for "Send Inactive" or similar. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Anaken Posted November 10, 2007 Author Share Posted November 10, 2007 Yeeaah! I has understood how to use it Link to comment Share on other sites More sharing options...
Anaken Posted November 10, 2007 Author Share Posted November 10, 2007 Does somebody know why if I use the ControlSend function two or more times to send a key to an inactive window, then this window activates. How to prevent that ? 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