Is there some way to watch for when a program starts without constantly polling?

  • Thread starter Thread starter Michael Brown
  • Start date Start date
M

Michael Brown

I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.
 
not .Net per se but WMI has events that handle this kind of stuff - you must
have the System.Management librairies installed

the Win32_ProcessStartTrace event - indicates that a new process has started

class Win32_ProcessStartTrace : Win32_ProcessTrace
{
uint4 PageDirectoryBase;
string ParentProcessName;
uint32 ProcessID;
string ProcessName;
uint8 SECURITY_DESCRIPTOR[];
uint32 SessionID;
uint8 Sid[];
uint8 TIME_CREATED;
};

check out the microsoft.public.dotnet.framework.wmi news group for more info
;-)
 
I found some info on PsSetCreateProcessNotifyRoutine()
this sounds like what I am looking for. However I can't find any C#
examples or an MSDN page talking about it, any help would be
appreciated.
 
-----Original Message-----
I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.
.

I found a way I belive using PsSetCreateProcessNotifyRoutine()
does anyone know how to use this in .NET?
 
Back
Top