Jump to content
  • Advertisement
Sign in to follow this  
Ancient Spirit

Disabling The Screensaver

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
In your WndProc, simply intercept the message, like so:




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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!