I started the task with help IRegisteredTask.Run()and got the object IRunningTask.
My goal is to focus the main window of the launched task using the function SetForegroundWindow.
First I want to know the PID (process identifier) of the current task.
There is a property IRunningTask.EnginePID, but it gives me the PID of some process taskeng.exe(Task Scheduler Engine), this is not my task ...
How to get IRunningTask PID?
source
share