Re: I'd like to apply new registry setting without rebooting.

At 05:36 01/11/2002 -0500, Taery wrote:

Hi All

I know that it is easy way to set key value of registry using control
panel. But I want to set the key value without rebooting.
And I’m looking for NT Native API like SystemParametersInfo.

Taery.

Not quite sure what you’re asking here, but if the question is how can an
application dynamically react to a change in registry parameters without
restarting the app then the way I usually do it is to use RegQueryInfoKey()
to retrieve the FILETIME struct and use this as the base value. Then I
kick off a thread that wakes up periodically and checks to see if the
FILETIME has changed. If it has, then I read and apply the new registry
parameters.

The sleep period in the thread is arbitrary and depends on acceptable latency.

(I believe Microsoft do something like this to protect certain sensitive
sections of the registry, i.e. those embarrassing things that in NT4
changed a workstation to a server)

If you really want to minimise the latency and use a CPL to change registry
settings for your app, then you could have the CPL signal a named event
that the application has a thread blocked on. (You might want to use the
above method as a backup in case someone uses RegEdit instead of your CPL)

If you are only asking generically about the o/s or applications out of
your control then the general answer is re-start or reboot for changes to
take effect.

Mark.