Disabling The Screensaver
Hello...
Can you please tell me how do i disable the screensaver?
And how do i disable the Power Settings? In other words, how do i prevent the monitor from turning off and the garddisk from turning off?
I am writing under C++ Win32 SDK and OpenGL.
Thanks in advance!
In your WndProc, simply intercept the message, like so:
This just fits in with your other messages. How this works is when the system sends the message, your application intercepts it, does nothing, and then tell windows it’s handled the situation. And thus, the screensaver doesn’t appear!
LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam){ if(ShowConsole == true) { RecvConsoleInput(hwnd, iMsg, wParam, lParam); } switch (iMsg) { //All your other messages go here case WM_SYSCOMMAND://if its a system command { switch (wParam)//enter the switch { case SC_SCREENSAVE://intercept the screensaver return 0;//prevent it from happening case SC_MONITORPOWER://intercept the powersave return 0;//prevent it from happening } break; } } return DefWindowProc (hwnd, iMsg, wParam, lParam); }
This just fits in with your other messages. How this works is when the system sends the message, your application intercepts it, does nothing, and then tell windows it’s handled the situation. And thus, the screensaver doesn’t appear!
Thank you! But what about the "Turn Off Hardisk" ?? I need to cancel it aswell... Does anyone knows how?
Thanks in advance.
Thanks in advance.
The hard drives will only spin down if there's no disk activity. If there is disk activity and the system is not suspended/powersaving (which you've taken care of by intercepting the appropriate messages), they'll spin up again.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement