Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
1.83/5 (6 votes)
See more:
I have a c# winform project which I wish that it can traverse all the controls and read their values of another c++ program (also can operate it, like clicking a button, inputing something etc.), can anybody give a clue, or an example, please? Thanks a lot.
Posted

First of all you need to get the handle of the other running program.
You can use EnumWindows to enumerate all running applications.

Once you have the handle to the other application you can use EnumChildWindows to get the handle to each of the controls.

To get the value of each control, you must send the WM_GETTEXT message using the control handle.
 
Share this answer
 
Comments
hal_cheung 29-Nov-10 21:33pm    
cheers m8
Go through the Below article.., how that can be implement

http://www.codeproject.com/KB/cs/SendKeys.aspx[^]
 
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