0

So, I was just wondering how I could enter text into a text box on a web page with a windows application.

Almost like a reverse screen scrape.

I know I have read somewhere about being able to do this but, I completely forgot how he did it. I think he may have been using Win32 DLLs which might be a fun endeavor but, getting off-topic now.

So, the question is: How can you inject text into text boxes that don't belong to your application with .NET (C#)

EDIT: Found my answer. See comments below.

Mashew
  • 561
  • 1
  • 5
  • 10
  • Found it. StackOverflow didn't find it but, Google did. http://stackoverflow.com/questions/450491/how-to-inject-text-to-the-cursor-focus – Mashew Jul 28 '09 at 01:47
  • I have experienced it before (http://stackoverflow.com/questions/1187821/is-it-fair-to-assume-that-client-must-have-javascript-enabled-while-developing-a). I searched before posting a question and found nothing, 1 min after posting the question, it was closed down because it was duplicate (I also voted to close it). SO rocks but search is only one thing that doesn't work too well. Perhaps an easier and simpler Google custom search would have been better. – Hemant Jul 28 '09 at 01:53

1 Answers1

2

Have a look at SendInput Win32 API. You'll need to focus on the correct window first, naturally. Also, it has some security restrictions on Vista and above, so that a low-privilege application cannot manipulate another one with higher privileges.

Pavel Minaev
  • 99,783
  • 25
  • 219
  • 289