Is there any way to get some Windows event when new application(s) gets added into memory/taskbar?
I can get running applications by iterating through Process.GetProcesses() (although, explorer processes will be excluded for some reason), but that means that I have to check for new processes every few seconds which isn’t very good.
I was wondering if there’s any interrupt that I can receive in C# application and then call the function to read the processes?
Any code samples would be great.
Thanks.
WMI Events can alert you when a new process is created. Depending on the event you may have to poll. Using the Win32_ProcessStartTrace class you don’t have to poll. New events are raised as events in your code. Below is an example (Add System.Management as a reference in your project)