Wait untill process is running or suspended

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AtleastItried
Posts: 51
Joined: 03 Mar 2017, 04:51

Wait untill process is running or suspended

17 Nov 2018, 14:54

I have been running this code every 25ms to get this information:

Code: Select all

IsProcessSuspended(pid) {
For thread in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Thread WHERE ProcessHandle = " pid) {
    If (thread.ThreadWaitReason != 5) {
        Return True
    } Else {
        Return False
    }
}
}
The problem is, that it is quite resource intensive. I am looking for a better way to find out of my process is currently running or suspended - or ideally something like WinWaitActive, but I doubt that exists. Eitherways, I really hope that you can help me, it's the only part of my program that still isn't performing well :/

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Dewi Morgan and 373 guests