各位大侠帮帮忙, 小弟的程序想知道当前系统电脑闲置的时间?delphi有没什么函数? 或如何取得,请各位指点...万分感谢!

解决方案 »

  1.   

    参考代码判断系统有多长时间没动过鼠标键盘了   
        
      function   LastInput:   DWord;   
      var   
          LInput:   TLastInputInfo;   
      begin   
          LInput.cbSize   :=   SizeOf(TLastInputInfo);   
          GetLastInputInfo(LInput);   
          Result   :=   GetTickCount   -   LInput.dwTime;   
      end;   
        
        
      procedure   TForm1.Timer1Timer(Sender:   TObject);   
      begin   
            Caption   :=   Format('鼠标键盘已经有   %d   秒没有使用',   [(LastInput)div   1000]);   
      end;