How to get PIRID IRunningTask (Task Scheduler Library 2.0)

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?

+3
source share
2 answers

You're right. The IRegisteredTask interface does not provide a PID property.

PID, .Path .Name IRegisteredTask , . , , IRegisteredTask, PID. , .

0

IRunningTask.InstanceGuid( TaskScheduler.IRegisteredTaskCollection)?

- -

- , , GUID .

0

Source: https://habr.com/ru/post/1781992/


All Articles