I have a Windows Mobile 5 program (compact framework 3.5) that should be able to detect when the device is down.
Now I'm just checking if the backlight is off. Like this:
[DllImport("coredll.dll", EntryPoint = "sleep", SetLastError = true)]
internal static extern void sleep(int dwMilliseconds);
....
int winError = CoreDLL.GetSystemPowerState(systemStateName, out systemPowerStates);
if (winError == 0)
{
if (systemStateName.ToString() == "backlightoff")
{
idle = true;
}
}
I think this may come close, but I would like to know if the device is really not in use.
source
share