-
October 22nd, 2007, 01:57 AM
#1
Avoiding Standby/Hibernation mode
Hi,
I am trying to stop Windows from entering Standby/Hibernation mode in C++ VS2005.
When the laptop's mouse or keyboard is not touched after a set amount of time, it enters Standby mode.
The laptops dont use XP's Standby feature, it uses the manufacturers power management utility instead.
Basically I need to generate a key press or mouse movement so the counter resets.
The problem is the code I have tried doesnt work.
So far I have tried:
1) Using GetCursorPos and SetCursorPos to move the mouse 1 pixel every 20 seconds.
2) Using PostMessage(WM_KEYDOWN, VK_SHIFT, NULL); and PostMessage(WM_KEYUP, VK_SHIFT, NULL);
3) Using the GenerateKey() function found here http://www.codeguru.com/forum/showthread.php?t=377393
These three techniques all do what they are expected to do (they move the mouse, and send key presses to notepad etc), but the Power Management utility ignores them, and the laptops still enter Standby Mode.
I tried getting a Keyboard Press Tester to pick up the key presses, but it didnt detect them (I am using http://passmark.com/products/keytest.htm ).
So somehow the Keyboard tester and the Power Management utility can detect the source of the key presses and ignores them. Perhaps they have put a Hook onto the keyboard/mouse driver or something.
Is there any way to fool them otherwise?
-
October 25th, 2007, 02:29 AM
#2
Re: Avoiding Standby/Hibernation mode
Im not sure, but read more about "ResetIdleTimer"
-
October 26th, 2007, 01:14 AM
#3
Re: Avoiding Standby/Hibernation mode
I found an alternative way to avoid standby
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
SetThreadExecutionState(ES_DISPLAY_REQUIRED);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|