1

Possible Duplicate:
How can I send keypresses to a running process object?

I have a windows software that has a login form and then automatically does something. I would like from my c# application to launch it and AUTOMATICALLY fil in the login form with username and password.

Using Process class I was able to launch programmatically the software, so my question is:

When the other process login form is shown it is possible to fill the data automatically from c#?

Community
  • 1
  • 1
user730712
  • 106
  • 1
  • 6

1 Answers1

3

The most straightforward way of doing this is probably to use something like Windows Input Simulator or straight calls to the Win32 API for input. Althought it's still a pretty fragile way of sending data between two programs, relying on Window focus, the UI not changing et c...

Anders Arpi
  • 8,277
  • 3
  • 33
  • 49
  • Nice - hadn't come across the input simulator before. – Dan Puzey Nov 23 '12 at 08:43
  • @user730712 You missed something there I think... ? – Anders Arpi Nov 23 '12 at 08:49
  • just to be clear, I have my application, I have another software that when is launched shows a login screeen. From my application is possible to simulate keystroke so to login? – user730712 Nov 23 '12 at 08:51
  • Indeed. I would recommend the duplicate question mentioned: http://stackoverflow.com/questions/2686865/how-can-i-send-keypresses-to-a-running-process-object (or check out Windows Input Simulator which I linked to). – Anders Arpi Nov 23 '12 at 08:52