title: Check to see if a Windows Mobile Device is Idle
body: <p>I have a windows mobile 5 program (compact framework 3.5) that I need to be able to detect when the device is idle.</p>
  
  <p>Right now I am just checking to see if the backlight is off.  Like this:</p>
  
  <pre><code>[DllImport("coredll.dll", EntryPoint = "sleep", SetLastError = true)]
  internal static extern void sleep(int dwMilliseconds);
  </code></pre>
  
  <p>....</p>
  
  <pre><code>//Get the current power state of the system
  int winError = CoreDLL.GetSystemPowerState(systemStateName, out systemPowerStates);
  if (winError == 0)
  {
      //If the backlight is off, consider the state to be idle.
      if (systemStateName.ToString() == "backlightoff")
      {
          idle = true;
      }
  }
  </code></pre>
  
  <p>I think this may be getting close, but I would like to know if the device is truly not being used.</p>