I would like to know if I can get any message to say that a particular open window has gone ?
Clearify: I open a notepad, type in some text, then I close it. I would like my C# program to display a message to state that my window has gone. I am new to C# so please suggest a class or classes I may need to look into, or better provide a short sample to demonstrate the main task. I am very thankful for your help.
Dirty but working way will be to poll the currently running processes with a Timer, comparing the list with the processes that were running in the previous polling you made.
First, add such class member to store the processes for comparing later:
Then, to start polling have such code:
And finally this is the polling and comparing code:
As long as your application will run, it will keep polling.