|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
update von registryHow can I update the registry, after i change a key value to take effect ?
There is nothing usefull in Microsoft.Win32.Registry und Microsoft.Win32.RegistryKey. Wie kann man in .NET ein Registry-Update machen ohne den Computer neuzustarten ? In Microsoft.Win32.Registry und Microsoft.Win32.RegistryKey konnte ich so was nicht finden. Anil Bakirci wrote:
> How can I update the registry, after i change a key value to take Isn't there?> effect ? There is nothing usefull in Microsoft.Win32.Registry und > Microsoft.Win32.RegistryKey. From the MSDN docs on RegistryKey.SetValue: SetValue - Sets the value of a name/value pair in the registry key. Depending on the overload, the registry data type is determined from the type of data being stored or from a specified RegistryValueKind. What exactly are you trying, and how is it not meeting your expectations? -cd The problem is that i have to restart the pc in order the registry setting
takes effect. Very simple example : RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Colors", true); regkey.SetValue("Background", "102 51 255", RegistryValueKind.String); regkey.Close(); i see that it is changed in the regeditor but it does only work after i restart the computer. i need an update function so that the restart would not be necessary. Show quote "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam> wrote in message news:uO4Bgc8uGHA.1504@TK2MSFTNGP03.phx.gbl... > Anil Bakirci wrote: >> How can I update the registry, after i change a key value to take >> effect ? There is nothing usefull in Microsoft.Win32.Registry und >> Microsoft.Win32.RegistryKey. > > Isn't there? > > From the MSDN docs on RegistryKey.SetValue: > > SetValue - Sets the value of a name/value pair in the registry key. > Depending on the overload, the registry data type is determined from the > type of data being stored or from a specified RegistryValueKind. > > What exactly are you trying, and how is it not meeting your expectations? > > -cd > > > The problem is that i have to restart the pc in order the registry setting Have you searched for documentation on that specific registry key?> takes effect. > Very simple example : > > RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"Control > Panel\Colors", true); > regkey.SetValue("Background", "102 51 255", RegistryValueKind.String); > regkey.Close(); > > i see that it is changed in the regeditor but it does only work after i > restart the computer. > i need an update function so that the restart would not be necessary. Some registry values only take effect after a restart, because they are read only once, or only after a logon sequence for example. If that is the case, there is very little you can do about it. if the registry editor shows the new value, it is really in the registry. There is no special update function. it all depends on the application / subsystem that reads the value. -- Kind regards, Bruno van Dooren bruno_nos_pam_van_doo***@hotmail.com Remove only "_nos_pam"
Show quote
"Anil Bakirci" <a***@sbox.tugraz.at> wrote in message What you're seeing is not related to updating the registry, but rather to news:%23uNq398uGHA.3500@TK2MSFTNGP06.phx.gbl... > The problem is that i have to restart the pc in order the registry setting > takes effect. > Very simple example : > > RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"Control > Panel\Colors", true); > regkey.SetValue("Background", "102 51 255", RegistryValueKind.String); > regkey.Close(); > > i see that it is changed in the regeditor but it does only work after i > restart the computer. > i need an update function so that the restart would not be necessary. caching of the UI parameters outside of the registry (e.g. in Explorer.exe and within the Win32 subsystem). Most of those UI-settings regristry keys are only read at startup, or when the WM_SETTINGSCHANGE message is received. Typically, after changing any of these settings, an application will post WM_SETTINGSCHANGE to all top-level windows on the system. Many applications will ignore this setting, but the Windows shell (explorer) does honor it. -cd |
|||||||||||||||||||||||