Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control another application using C#

Tags:

c#

winforms

I need to control other application by simulating mouse movement and keyboard input. How do I accomplish this in C#? Is it even possible?

like image 282
Salamander2007 Avatar asked Jul 16 '09 01:07

Salamander2007


1 Answers

Have you looked at White TestStack?

Sample code:

Application application = Application.Launch("foo.exe"); Window window = application.GetWindow("bar", InitializeOption.NoCache);  Button button = window.Get<Button>("save"); button.Click(); 

I don't think it can get better than that. The library is created by ThoughtWorks.

like image 115
SolutionYogi Avatar answered Sep 18 '22 10:09

SolutionYogi