Detecting application close

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
 
R

Roger

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
 
N

Neven Klofutar

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

Process.GetProcessesByName(sProcesName)


Neven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top