Ask a questionAsk a question
 

AnswerDifference between user idle and idle

  • Monday, July 06, 2009 9:35 PMLtty Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    As I am working with power policies and power state I recognized that besides unattended, on, off etc there is a state called user idle which turns the display off but keeps the device's hardware and all applications running. However, I found out that there is also a state called idle and I was wondering what the difference between idle and user idle was?

Answers

  • Monday, July 06, 2009 10:01 PMMichel Verhagen [eMVP]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    User Idle - No user input
    System Idle - No system activity (no applications active)

    Normally the system transfers states as follows:

    On -> User Idle -> System Idle -> Suspend (or off)

    Maybe we can help you better if you explain what you are trying to do...

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://GuruCE.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://GuruCE.com
    Consultancy, training and development services.

All Replies

  • Monday, July 06, 2009 10:01 PMMichel Verhagen [eMVP]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    User Idle - No user input
    System Idle - No system activity (no applications active)

    Normally the system transfers states as follows:

    On -> User Idle -> System Idle -> Suspend (or off)

    Maybe we can help you better if you explain what you are trying to do...

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://GuruCE.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://GuruCE.com
    Consultancy, training and development services.
  • Tuesday, July 07, 2009 4:58 AMAmit Rote Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Michel,

    I am also looking for the same.
    However my requirement is to get the UserIdleness. I mean to detect the User Idle time and take the action.
    Let me explain the same by taking an example of screen saver application. What i would like to do is, my application will be always running and looking for the User Idle time.
    If it detects the UserIdleness for some threshold time (say 5 mins) then it will launch the UI screen. In short if user is continue Idle for 5mins then application will launch the UI screen.
    I hope you understand the requirement.

    So can you please let me know how i can detect the User Idle time?

    Thanks,
    Amit Rote
  • Tuesday, July 07, 2009 8:56 AMLtty Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am developing an application that needs to perform tasks in the background... At first I tried using unattended mode but in unattended mode only my application is running and I do not get data from sensors (e.g. accelerometer) which my application requires. Also buttons are disabled and I have a keyhook that needs to stay active all the time...

    Despite the fact that my application needs to run all the time and I need access to parts of the hardware I have to optimize the power management which is quite difficult regarding my application's requirements. At the moment I use the user idle mode where display and backlight is off but sensors, buttons and my application keeps running...

    So I was wondering whether I should use user idle or system idle but anyhow you answered my question because my application won't be running in system idle mode.
  • Tuesday, July 07, 2009 9:06 AMLtty Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Amit,

    I do not know whether this is what you are looking for but there is a Timer CalledSystemIdleTimerReset which is able to keep the device awake (http://msdn.microsoft.com/en-us/library/aa930260.aspx).

    Anyhow OpenNETCF provides some events to detect power state changes which can be used or at least adjusted so you can use them for your application.

    If you do not need the time to be counted in seconds exactly, you could use a Timer and the GetSystemPowerState method from the SDF or WIN32 API (P-Invoke) to detect the UserIdle mode. Once you are in user idle mode you could set a flag and remember the time. Each tick of the timer you compare the recorded time to the current time and when it exceeds your interval you can launch your application and reset the flag.