I am watching a program and want to kill it if it is in the "wait: executive" state for some time.
Here is a screenshot of Process Explorer:

How can I get this status by code? Or maybe they will tell me what exactly this means? This will help me find the right query to solve my problem.
source share