Deathspike Posted June 28, 2010 Share Posted June 28, 2010 (edited) Hello. I have a window handle as a string and use it in ControlSend, as it is shown around these forums. However, the message never arives, nothing is executed. I cannot use a handle on ControlSend, WinActive, and more. Please help me out, what is wrong here (the following code is C#). string hwnd = AutoItX.WinGetHandle( "Untitled - Notepad" ); AutoItX.ControlSend( "handle=" + hwnd, "", "Edit1", "Hello", 0 ); Taking any advice that might work (it must be using hwnd though)! Edited June 28, 2010 by Deathspike Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted June 28, 2010 Share Posted June 28, 2010 If AutoItX is anything like AutoIt then you're doing it all wrong. Did you not look at anything in the helpfile? Where is the square brackets? What happened with the colon?And no, I have never used AutoItX so I can't leave any guarantee for anything, but seriously, your code looks nothing like the ones in helpfile. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Deathspike Posted June 28, 2010 Author Share Posted June 28, 2010 If AutoItX is anything like AutoIt then you have some errors. Did you not look at the helpfile? You are probably missing some square brackets and/or colons.Thanks for the reply. It only required brackets. I fixed your message by the way. It's called a less hostile reply. Link to comment Share on other sites More sharing options...
Authenticity Posted June 28, 2010 Share Posted June 28, 2010 AutoItX3Class ai = new AutoItX3Class(); ai.Run("notepad.exe", "", ai.SW_SHOWNORMAL); ai.WinWaitActive("[class:Notepad]", "", 0); string hwnd = ai.WinGetHandle("[class:Notepad]", ""); hwnd = "[handle:" + hwnd + "]"; ai.ControlSetText(hwnd, "", "Edit1", "12345678"); ai.WinSetState(hwnd, "", ai.SW_MINIMIZE); ai.WinWaitNotActive(hwnd, "", 0); string hCtrl = ai.ControlGetHandle(hwnd, "", "Edit1"); hCtrl = "[handle:" + hCtrl + "]"; ai.ControlSend(hCtrl, "", "", "{END}{ENTER}12345678", 0); ai.WinSetState(hwnd, "", ai.SW_RESTORE); Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 21, 2010 Share Posted August 21, 2010 1. This is AutoIt, not AHK. 2. It's "AutoIt", not "AutoIT". 3. No bots. That's not only against our rules but also the game's rules. 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