Jump to content

using controlsend/controlclick


 Share

Recommended Posts

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

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 work

Thanks for this

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.

wow I was not aware of this cool little trick

thank you very much

Edited by jeanbern
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...