AlexR Posted February 27, 2008 Share Posted February 27, 2008 Hello experts, Ive got a little problem I hope someone could help me. Yesterday I tried to use AutoItX3Lib.AutoItX3 to write a code in vb .net so execute my windows application. My windows application contains just one Button and one textbox. To click my button going well. Ive got no problem to use and click the button, but I cant write a text in my text box. Here is my code: Dim objAutoIt As New AutoItX3Lib.AutoItX3 objAutoIt.Run("C:\myapplication.exe") objAutoIt.WinWaitActive("Form1") 'Press Button objAutoIt.ControlClick("Form1", "", "Button2") objAutoIt.WinClose("Form1") To work with the textbox same way fails. code like : objAutoIt.ControlFocus("Form1", "", "TextBox1") objAutoIt.ControlSetText("Form1", "", "TextBox1", "Hello") fails too. Have someone a tip for me? Best regards, (desperated) Alex Link to comment Share on other sites More sharing options...
DarkMatter Posted March 25, 2008 Share Posted March 25, 2008 Did you check and make sure the Textbox control ID is actually TextBox1? [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
Zedna Posted March 25, 2008 Share Posted March 25, 2008 Use Au3Info.exe to observe right ClassNameNN. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
DarkMatter Posted March 25, 2008 Share Posted March 25, 2008 Use Au3Info.exe to observe right ClassNameNN.If I create a quick VB.NET app with a simple textbox and simple button the following are the control classes:TextBox1 = WindowsForms10.EDIT.app.0.378734a1Button1 = WindowsForms10.BUTTON.app.0.378734a1Not sure why the ClassNameNNs are like that, but I'm sure it has something to do with the .NET framework. Use what Zedna suggested and use Au3Info.exe(AutoIT Window Info) to identfy the ClassNameNN. [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
testMunky Posted April 8, 2008 Share Posted April 8, 2008 Just to add to what MattWise said, the class names are like that due to the .net framework, and just beware, if your apps are anything like ours these can actually change at runtime (which i discovered to my annoyance). I retrieve the current classname for my main app/window using: $windowClassName = _ReturnClass($titleMain) which i then go on to use and/or modify for use elsewhere. 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