Monitoring program launches

  • Thread starter Thread starter Paul Steele
  • Start date Start date
P

Paul Steele

Are there any Windows hooks or Win32 API calls that would let a C# program
log program launches?
 
Hi Paul
You can Use the Trace Class or the Debug Class to write all the entries you
want to the Application log on your machine ( or you can even create your
custom log )

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticstraceclasstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticstraceclasstopic.asp
what can also do is to use the big number of counters offered by the
performance counter to check the execution steps of your application. You
can read more about the performance counter class on this link

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdiagnosticsper
formancecounterclasstopic.asp

hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
I guess my original question was a bit vague. I want to log the launches of
other programs, not my own. In addition to logging program executions, I
would like to be able to optionally prevent a program from running. I've
found a simple way around this by periodically getting the list of processes
and closing those that shouldn't be running. I would prefer finding a
prevent the programs from running at all.
 
Back
Top