I am building a program that logs 3D processes in the background. Some of them are running as administrator and I need to run elevated to capture those. I am using psapi EnumProcesses with p/invoke. My question now is: how do I architect this to have the program:
- start on user login
- capture processes with elevated rights
- Have UI and TaskIcon present
- Able to restart / shutdown my program
I looked at TaskScheduler solutions but there seem to be issues with launching a UI and the TaskBar icon might not show up, so that seems to be no solution, at least in the way suggested.
I have seen people recommend a separate process to run as task / service and then communicate with it. If this is a better and recommended solution, what is the recommended way to communicate with the other process in C#? I have seen people recommend named pipes and RPC.
So in summary, my question is, how do I architecture this the proper ".NET (4.6) / C# on Windows 10" way?