You call the IsHungAppWindow function to determine if Microsoft® Windows® considers that a specified application is not responding, or "hung". An application is considered to be not responding if it is not waiting for input, is not in startup processing, and has not called PeekMessage within the internal timeout period of 5 seconds. SyntaxBOOL IsHungAppWindow( HWND hWnd );
好像没有直接的方法吧,可以试试用 GetProcessTimes 然后比较 kernel times 和 user times , 如果某个时间段产生的 kernel times >> user times 应该是比较空闲,如果 user times == 0 可能是 SuspendedBOOL GetProcessTimes( HANDLE hProcess, // handle to process LPFILETIME lpCreationTime, // process creation time LPFILETIME lpExitTime, // process exit time LPFILETIME lpKernelTime, // process kernel-mode time LPFILETIME lpUserTime // process user-mode time );
);
HANDLE hProcess, // handle to process
LPFILETIME lpCreationTime, // process creation time
LPFILETIME lpExitTime, // process exit time
LPFILETIME lpKernelTime, // process kernel-mode time
LPFILETIME lpUserTime // process user-mode time
);
masterz的方法只能适用于有窗口的进程,但是我要访问的进程是没有窗口的,masterz,请问有没有其他的方法?
Waiting就是通常说的Blocked,在nt里面名称不一样。