MSN是怎么发现你多长时间没有键盘和鼠标操作的?
怎么写相应的处理程序?
请给出代码 谢谢

解决方案 »

  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; 
      

  2.   

    function LastInput: DWord;  这个函数只能在win 2000系统中使用吗?