Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,I want to get text of a textbox in another program.Is this possible?
can you help me please?
Posted
Comments
[no name] 13-Sep-12 10:54am    
Yes it's possbile. Use P/Invoke to find the window and get the window text.
Andrei Straut 13-Sep-12 11:17am    
Done. BTW, that API was my introduction to .NET :). I instantly fell in love with it, and still use it now and then for small hacks at home
Andrei Straut 13-Sep-12 11:14am    
Sorry, I replied to Wes' comment. Deleted it and moved here

As well as Wes' solution, you can try taking a look at the MS UI Automation Framework (.NET API). Assuming the other program wasn't written in Java (I've found that most of those don't expose their UI Automation IDs and properties), you'll actually get a .NET API allowing you to automate really large parts of the other application

MSDN Link[^]
[no name] 13-Sep-12 11:15am    
*I* think you should post this as an actual solution. :-)
Andrei Straut 13-Sep-12 11:17am    
Done. BTW, that API was my introduction to .NET :). I instantly fell in love with it, and still use it now and then for small hacks at home

1 solution

As well as Wes' comment (should also count as a solution), you can try taking a look at the MS UI Automation Framework (.NET API). Assuming the other program wasn't written in Java (I've found that most of those don't expose their UI Automation IDs and properties), you'll actually get a .NET API allowing you to automate really large parts of the other application

MSDN Link[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900