title: Delphi : Get active user idle time from Service
body: <p>i'm using this code to get the local idle time from Windows Application
  but when i use it on Service it not returning the active user idle time </p>
  
  <pre><code>function IdleTime: DWord;
  var
    LastInput: TLastInputInfo;
  begin
    LastInput.cbSize := SizeOf(TLastInputInfo);
    GetLastInputInfo(LastInput);
    Result := (GetTickCount - LastInput.dwTime) DIV 1000;
  end;
  </code></pre>
  
  <p>any idea ?</p>
  
  <p>thanks in advance</p>