Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Refresh windows from registry without rebooting

Posted on 2002-06-05
8
Medium Priority
?
661 Views
Last Modified: 2013-12-03
Well from the title above, I'm trying to create a program that cuase windows to automatically refresh all its settings from the registry as my program changes something in the registry but I want windows to detect/apply the changes without having to reboot. I've seen some program that could do this, I think it was one of the micrsoft power tools but I can't remember and then I see that some VB programs can do these as well but I need to know how to do it in VC++. I hoping that someone can give me an example coding that I can use or point me to some website that teaches this.
0
Comment
Question by:TDR
[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
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7056022
The link http://codeproject.com/tips/resswitch.asp contains How to change the display settings

I'm looking for a generic one.


GOOD LUCK
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7056187
Try to broadcast a WM_WININICHANGE.
0
 
LVL 86

Accepted Solution

by:
jkr earned 1050 total points
ID: 7056208
This is usually done by broadcasting a 'WM_SETTINGCHANGE' - see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_4d5x.asp ('WM_SETTINGCHANGE') and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11e.asp ('Using System Settings and Notifications')
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 86

Expert Comment

by:jkr
ID: 7056214
>>Try to broadcast a WM_WININICHANGE.

"WM_WININICHANGE
The WM_WININICHANGE message is obsolete. It is included for compatibility with earlier versions of the system. New applications should use the WM_SETTINGCHANGE message."
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7056257
Sorry, forgot about that. Best broadcast both messages. There are still programs around which only react to the old message.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 7058719
:-)

From Delphi's windows.pas file:

const WM_SETTINGCHANGE = WM_WININICHANGE;

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 7058726
TDR, you can't generally force anyone to reload registry values. You should use SystemParametersInfo or other APIs to change system settings. In that case it most of the time works without reboot. Also you can try broadcasting WM_SETTINGCHANGE/WM_WININICHANGE, as also suggested. But that only helps for some registry values, by far not for all. Also you could programmatically post a F5 key to the window which should be refreshed. There are a few more such hacks, but after all you can't force every program to reload its registry values. It depends on how each program is written, whether it reacts on WM_SETTINGCHANGE and the like...

Regards, Madshi.
0
 

Author Comment

by:TDR
ID: 7061891
Though I haven't really tried out this solution yet but at least its an idea I can work on at least and search from there...Thanks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 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