Solved

SCREEN SAVER problem

Posted on 2002-03-12
4
277 Views
Last Modified: 2013-11-20
I have written a Windows Screen Saver. Now when I install it, I try to make it default screen saver for current user. For doing this I change registry entries at path <b>HKEY_CURRENT_USER\Control Panel\Desktop</b>, but after doing changes when I click on Screen Saver dialog box properties then I can't see my screen saver as default screen saver but if I restart my computer then after that I can see my screen saver as active one. I need to know that
 1. why I need to restart my computer to make my screen saver as active.
 2. should I have to do something other then changing registry entries, so that I don't need to restart my computer.

Please HELP me.
0
Comment
Question by:lkjhgfdsa
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Crius
ID: 6857448
Well, for the first part, you are making registry entries.

Registry entries are usually read only upon program startup, and that's why most programs that modify registry settings that affect the operating system have to reboot the operating system to read in the new values.

While I'm not sure it will help, you may want to study WM_SETTINGCHANGE help file in MSDN. It may be able to do what you want...
0
 

Author Comment

by:lkjhgfdsa
ID: 6859813
But WM_SETTINGCHANGE is required to be send to some WINDOW, but to whom should I send this message???
0
 
LVL 3

Accepted Solution

by:
Crius earned 40 total points
ID: 6861154
As stated from the MSDN help files under WM_SETTINGCHANGE:

WM_SETTINGCHANGE
The system sends the WM_SETTINGCHANGE message to all top-level windows when the SystemParametersInfo function changes a system-wide setting or when policy settings have changed.

Applications should send WM_SETTINGCHANGE to all top-level windows when they make changes to system parameters. (This message cannot be sent directly to a window.) To send the WM_SETTINGCHANGE message to all top-level windows, use the SendMessageTimeout function with the hwnd parameter set to HWND_BROADCAST.

A window receives this message through its WindowProc function.


I hope this works for you.. :)
0
 

Author Comment

by:lkjhgfdsa
ID: 7130156
Thanx, I found a function name from your comment, which is SystemParametersInfo, I used this function like this SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, ssTimeout, NULL, 0) to solve out my problem.

thanx.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now