This function supercedes SHIdleTimerReset by enabling the application to specify which timer gets reset.


            HRESULT WINAPI SHIdleTimerResetEx(


  • dwFlags
    Indicates which session timer(s) to reset. Can be any combination of the timers as shown in the following table.

    Value Description


    Reset device lock session timer.


    Reset home session timer (Windows Mobile Standard only).


    Reset flush session timer (Windows Mobile Standard only).


    Call SystemIdleTimerReset.

Return Value

This function returns S_OK on success. Currently no failure codes are returned.


Calling SHIdleTimerResetEx(LOCK_SESSION | HOME_SESSION | FLUSH_SESSION) is equivalent to calling SHIdleTimerReset.

SHIdleTimerResetEx can be called by applications to prevent the home screen from coming forward but still allowing device lock to function. In this case the function would be called with HOME_SESSION | FLUSH_SESSION. An example of such an application is a media player application which can call SHIdleTimerResetEx while playing video.

Windows Mobile Professional and Windows Mobile Classic only support LOCK_SESSION and IDLE_SESSION. If IDLE_SESSION is specified, SystemIdleTimerReset will be called which will keep the device from suspending. LOCK_SESSION is the timer that controls when the device will lock. If the device has been user idle for X amount of time the device locks. Calling this function with LOCK_SESSION periodically will prevent the device from auto locking.

HOME_SESSION is the timer that controls when the system will revert to showing the home screen on Windows Mobile Standard. Periodically calling the SHIdleTimerResetEx with HOME_SESSION will prevent the system from automatically switching back to the home screen. FLUSH_SESSION is the timer that controls the periodic flushing of the registry and databases to persistent storage. Note than on power off and suspend these are always flushed. Periodically calling this function with FLUSH_SESSION will prevent the device from performing its periodic flush to persistent storage.


Header aygshell.h
Library aygshell.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile 6 Classic and later, Windows Mobile 6 Professional and later, Windows Mobile 6 Standard and later

See Also


Shell Functions