Jump to content
  • Advertisement
Sign in to follow this  
Z3R0Bit

C# question

This topic is 3973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I read text from a textbox or smth like that from another application. Tell me if u didn't get the idea.

Share this post


Link to post
Share on other sites
Advertisement
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
You can use

textbox.text to stock in a string

example :

string mytext = "";

mytext = textbox.text;

So simple :)

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!