?
Solved

How to disable screen saver?

Posted on 1998-12-09
5
Medium Priority
?
425 Views
Last Modified: 2010-04-02
How to disable screen saver from running while my program is running?
In win98 and winnt 4.
0
Comment
Question by:stl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Expert Comment

by:sunj
ID: 1179794
try this:
      SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,FALSE,0,0);

sunj
0
 

Author Comment

by:stl
ID: 1179795
Does not work in win98...
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1179796
You have to set the registry value in:
HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveActive = 0  
or perhaps ScreenSaveTimeOut = 4,294,967,295
use the RegOpenKey and RegSetValue functions to set the values..
 

0
 

Author Comment

by:stl
ID: 1179797
The registry settings is changed.
But windows need to be restarted to take effect for the new setting!
0
 
LVL 1

Accepted Solution

by:
prozak earned 100 total points
ID: 1179798
Try adding this code to your window function:

switch (message)
{
  // add this code
  case WM_SYSCOMMAND :
    if(wParam == SC_SCREENSAVE)
      return 0;
    break;
  // end add code
}

This will eat all of the screen saver messages generated by windows and the screen saver will not start. This should work on all versions of windows.

Hope this helps...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question