penartur
penartur

Reputation: 9922

How to interact with the Windows applications with GUI?

I want to write a convenient front-end to the old and ugly Win95 application. I nailed the problem to this:

  1. Invoke the target executable;
  2. Wait for application window to appear;
  3. Wait for message box (i hope it is a message box) to appear;
  4. Trigger an onClick event for the "OK" button of the message box;
  5. Wait for the application to exit.

1st and 5th items are easy, it is just the System.Diagnostics.ProcessStartInfo stuff; but i have no idea where to start with the rest of items. How could it be done?

Upvotes: 1

Views: 1280

Answers (2)

Mike Miller
Mike Miller

Reputation: 16575

Take a look at the windows automation framework, this is a good starter codeproject.com/Articles/141842/

Sorry for the delay.

Upvotes: 2

Frank Razenberg
Frank Razenberg

Reputation: 531

If it's not too much of an effort you could open up the executable in a disassembler (like ollydbg) and simply NOP the call to the messagebox. Then from C# you could simply wait for the process to exit instead of dismissing the messagebox using code.

Upvotes: 1

Related Questions