Link to home
Start Free TrialLog in
Avatar of rodmjay
rodmjayFlag for United States of America

asked on

trigger an event when an application stops

I have a program i wrote, lets call it ProgramA...  basically it opens another program lets call it ProgramZ, and gains a handle to the program using the User32.dll.  What im trying to do is have ProgramA display a message box when ProgramZ gets closed (when the user closes ProgramX).
Avatar of Jens Fiederer
Jens Fiederer
Flag of United States of America image

You can have ProgramA dedicate a thread to using System.Diagnostics.Process.WaitForExit, and have the thread exit and raise the event in the UI thread.
Avatar of rodmjay

ASKER

sounds cool... how does that look in code?
ASKER CERTIFIED SOLUTION
Avatar of Jens Fiederer
Jens Fiederer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial