如题!比如正在运行全屏程序,正在看碟,鼠标或键盘已有一段时间未作任何动作了等等!

解决方案 »

  1.   

    >>鼠标或键盘已有一段时间未作任何动作了等等!function LastInput: DWord; 
    var 
      LInput: TLastInputInfo; 
    begin 
      LInput.cbSize := SizeOf(TLastInputInfo); 
      GetLastInputInfo(LInput); 
      Result := GetTickCount - LInput.dwTime; 
    end; 
    //Example: 
    procedure TForm1.Timer1Timer(Sender: TObject); 
    begin 
      Label1.Caption := Format('System Idle since %d ms', [LastInput]); 
    end;