Apply registry changes immediately

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me how to force an immediate apply of system based registry changes. I have an application written in C# that updates the registry. However I’m forced to logout and log back in for the changes to take effect. I need to figure out how to have an apply button (just like the one in Microsoft power tweak). Any help is greatly appreciated.
 
What specific system settings are you trying to change? There are API
functions that will reload some of them and others can only be read as part
of the user settings upon login. There are still others that will only be
read on startup - so the answer to your question really depends on what it
is you're trying to change.

Dale


Troy Heber said:
Can anyone tell me how to force an immediate apply of system based
registry changes. I have an application written in C# that updates the
registry. However I'm forced to logout and log back in for the changes to
take effect. I need to figure out how to have an apply button (just like the
one in Microsoft power tweak). Any help is greatly appreciated.
 
I'm trying to apply changes in two different areas (local machine & current user):

1. HKEY_CURRENT_USER\Control Panel\Desktop
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

If you could point me to the documentation on the API functions to apply the settings I would really appreicate it. I have searched and searched and can't find it.

Thanks for the reply!!

Troy

----- DalePres wrote: -----

What specific system settings are you trying to change? There are API
functions that will reload some of them and others can only be read as part
of the user settings upon login. There are still others that will only be
read on startup - so the answer to your question really depends on what it
is you're trying to change.

Dale


Troy Heber said:
Can anyone tell me how to force an immediate apply of system based
registry changes. I have an application written in C# that updates the
registry. However I'm forced to logout and log back in for the changes to
take effect. I need to figure out how to have an apply button (just like the
one in Microsoft power tweak). Any help is greatly appreciated.
 
For that first set, it looks like you're hacking the regstry instead of using
the SystemParametersInfo API.
--
Phil Wilson [MVP Windows Installer]
----
Troy Heber said:
I'm trying to apply changes in two different areas (local machine & current user):

1. HKEY_CURRENT_USER\Control Panel\Desktop
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

If you could point me to the documentation on the API functions to apply the
settings I would really appreicate it. I have searched and searched and can't
find it.
 
Troy, Phil is right. Use SystemParametersInfo along with WM_SETTINGCHANGE
message. You don't really say what you want to change on or about the
desktop, but if it is video settings/colors, etc. you might start with
these:

Microsoft had an article on MSDN a few years ago entitled Creating A
ScreenInfo Class. You may want to find an old MSDN disk and try to track
that down. It includes descriptions of using EnumDisplaySettings and
ChangeDisplaySettings.

As for the Services area, that's outside my experience. Hopefully someone
else can point you in the right direction for that one.

Dale


Phil Wilson said:
For that first set, it looks like you're hacking the regstry instead of using
the SystemParametersInfo API.
--
Phil Wilson [MVP Windows Installer]
----
Troy Heber said:
I'm trying to apply changes in two different areas (local machine &
current
user):

1. HKEY_CURRENT_USER\Control Panel\Desktop
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

If you could point me to the documentation on the API functions to apply
the
settings I would really appreicate it. I have searched and searched and can't
find it.
Thanks for the reply!!

Troy

----- DalePres wrote: -----

What specific system settings are you trying to change? There are API
functions that will reload some of them and others can only be read
as
part
of the user settings upon login. There are still others that will
only
be
read on startup - so the answer to your question really depends on
what
it
is you're trying to change.

Dale


based
registry changes. I have an application written in C# that updates the
registry. However I'm forced to logout and log back in for the changes to
take effect. I need to figure out how to have an apply button (just
like
the
one in Microsoft power tweak). Any help is greatly appreciated.
 
Back
Top