Sign in to follow this  
Z3R0Bit

C# question

Recommended Posts

You could use Spy++ to get the Window Handle of the edit control.
Then something like this should work:

TextBox test = Control.FromHandle(<HWND you found via Spy++>) as TextBox;
//do something with test.Text

Share this post


Link to post
Share on other sites
Quote:
Original post by Maldus
You can use

textbox.text to stock in a string

example :

string mytext = "";

mytext = textbox.text;

So simple :)


That is indeed simple. It's also not what he's trying to do :)

Share this post


Link to post
Share on other sites
To read the text from a control in another application, you will have to use P/Invoke to send a WM_GETTEXT message to the control with SendMessage() or PostMessage(). You will need to know the handle of the control; this can be obtained using Spy++ (nice and easy, for testing purposes), or using some combination of FindWindow()/EnumChildWindows()/etc.

SendMessage at pinvoke.net

Share this post


Link to post
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

Sign in to follow this