rt

解决方案 »

  1.   

    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
    );
      

  2.   

    好像没有直接的方法吧,可以试试用 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
    );
      

  3.   

    In355Hz的方法太不可靠了吧,而且我试验过,当进程因为某种事件阻塞的时候,KernelTime往往也是不增加的。
    masterz的方法只能适用于有窗口的进程,但是我要访问的进程是没有窗口的,masterz,请问有没有其他的方法?
    Waiting就是通常说的Blocked,在nt里面名称不一样。