TDR
asked on
Refresh windows from registry without rebooting
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.
Try to broadcast a WM_WININICHANGE.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>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."
"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."
Sorry, forgot about that. Best broadcast both messages. There are still programs around which only react to the old message.
:-)
From Delphi's windows.pas file:
const WM_SETTINGCHANGE = WM_WININICHANGE;
Regards, Madshi.
From Delphi's windows.pas file:
const WM_SETTINGCHANGE = WM_WININICHANGE;
Regards, Madshi.
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_WININI CHANGE, 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.
Regards, Madshi.
ASKER
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
I'm looking for a generic one.
GOOD LUCK