\ File: rstimer.spf \ Author: Oleg Romanovich (2:450/173) \ Description: Prevent resume 5-minutes sleep mode after automatically wake-up \ If windows wakes-up automatically (for example, timer wake-up), \ it resume sleep or hibernate mode after about 5 minutes, when the user \ activity not detected and no scheduling tasks are running. \ Periodically (once for 2-5 minutes) calling ResetSuspendTimer prevent \ this situation. \ Usage: ResetSuspendTimer \ Param: ES_SYSTEM_REQUIRED Informs the system that the thread is \ performing some operation that is not \ normally detected as activity by the \ system. \ ES_DISPLAY_REQUIRED Informs the system that the thread is \ performing some operation that is not \ normally detected as display activity \ by the system. \ ES_CONTINUOUS Informs the system that the state being \ set should remain in effect until the \ next call that uses ES_CONTINUOUS and \ one of the other state flags is cleared. \ Example: ES_SYSTEM_REQUIRED ResetSuspendTimer 0x00000001 CONSTANT ES_SYSTEM_REQUIRED 0x00000002 CONSTANT ES_DISPLAY_REQUIRED 0x80000000 CONSTANT ES_CONTINUOUS WINAPI: SetThreadExecutionState KERNEL32.DLL WINAPI: IsSystemResumeAutomatic KERNEL32.DLL : ResetSuspendTimer { param -- } IsSystemResumeAutomatic IF param SetThreadExecutionState DROP THEN ;