Detecting application close

  • Thread starter Thread starter Neven Klofutar
  • Start date Start date
N

Neven Klofutar

hi,


A friend is configuring windows in a way that he's not using explorer shell,
he's using something else (I hope I wrot this corectlly :) ).
Now ... when shell is closed he want's to close windows down.

Is it possible to create windows service that can "listen" when will an
application (shell) close and then start windows shutdown ? (windows
shutdown is rather trivial, I'm more conserned about first part of the
problem).

I hope you'll understard this :)

thanx, Neven
 
Is it possible to create windows service that can "listen" when will an
application (shell) close and then start windows shutdown ? (windows
shutdown is rather trivial, I'm more conserned about first part of the
problem).


Have a look at System.Diagnostics.Process
It has an Exited event which is fired whenever the associated process
terminates. You could look up the process for your shell object and
then just handled the Exited event.

I'm not aware of any reason why this wouldn't work within a windows
service.

- Roger
 
Thanx, I solved it with Windows Service and using timer.

Process.GetProcessesByName(sProcesName)


Neven
 
Back
Top