c# - How to catch new processes starting and stopping? -


this question has answer here:

i wanted know if knows of way catch new applications starting or stopping on computer. instance, user logs in , opens word, outlook, or ie. want catch instance opening. have been working process.

i building service runs in background , writes event log.

       public string applicationid()     {         process p = new process();         string application = p.processname.tostring();         return application;     } 

i know foreach process list. pointers or samples great.

once have process object, can add handler "exited" event detect when stops. note "enableraisingevents" property must set "true" work, can set after process object using getprocesses().

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -