jeanbern Posted December 6, 2009 Share Posted December 6, 2009 I have an application that I made in C# and I'd like to send a string to a TextBox from my autoit program and I'd also like to click a button (I can change the C# programto make this work) I tried tinkering with all sorts of settings and nothing could make it work The best I was able to do was send a string to the application and it would go to whichever textbox was focused on but I'd like to do it without focusing on the object and sending to that object in particular anyone know how to do this? or even understand what I'm talking about Link to comment Share on other sites More sharing options...
Authenticity Posted December 6, 2009 Share Posted December 6, 2009 C# Windows Form or C# WPF? For Windows Form you can do something like:$hWnd = WinGetHandle("Form1") $hEdit = ControlGetHandle($hWnd, "", "WindowsForms10.EDIT.app.0.378734a1") ControlSetText($hEdit, "", 0, "new text")where WindowsForms10.EDIT.app.0.378734a is the control class name and the followed 1 is the class instance. Link to comment Share on other sites More sharing options...
jeanbern Posted December 6, 2009 Author Share Posted December 6, 2009 (edited) C# Windows Form or C# WPF? For Windows Form you can do something like:$hWnd = WinGetHandle("Form1") $hEdit = ControlGetHandle($hWnd, "", "WindowsForms10.EDIT.app.0.378734a1") ControlSetText($hEdit, "", 0, "new text")where WindowsForms10.EDIT.app.0.378734a is the control class name and the followed 1 is the class instance.The TextBox and Button are in a windows form yes.how do I go about finding the "WindowsForms10.EDIT.app.0.378734a1" for what I'm trying to do"TextBox10.EDIT.app.0.378734a1" doesn't workThanks for thisAutoIt v3 Window Info It's included in AutoIt installation so you probably have it. Try Ctrl+F6 from SciTE. Optionally, you can download WinSpy++ which is similar.wow I was not aware of this cool little trickthank you very much Edited December 6, 2009 by jeanbern Link to comment Share on other sites More sharing options...
Authenticity Posted December 6, 2009 Share Posted December 6, 2009 AutoIt v3 Window Info It's included in AutoIt installation so you probably have it. Try Ctrl+F6 from SciTE. Optionally, you can download WinSpy++ which is similar. 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