T
T
TechNOIR2019-03-29 15:20:57
C++ / C#
TechNOIR, 2019-03-29 15:20:57

C#. Is it possible to apply registry values ​​without reboot?

Hello.
Through the program I change the value in the registry. The value changes.
But how to programmatically apply the modified registry values? For them to take effect
Is this possible?
Thanks in advance
PS I'm trying to change the screen scale through the registry

RegistryKey currentUserKey = Registry.CurrentUser.OpenSubKey("Control Panel", true).OpenSubKey("Desktop", true).OpenSubKey("PerMonitorSettings", true);
string[] str = currentUserKey.GetSubKeyNames();
 RegistryKey moni = Registry.CurrentUser.OpenSubKey("Control Panel", true).OpenSubKey("Desktop", true).OpenSubKey("PerMonitorSettings", true).OpenSubKey(str[0], true);
moni.SetValue("DpiValue", dpi);

The value changes, but it needs to be applied somehow..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2019-03-29
@Zoominger

Restart the service or program that reads this value. If the service is a system one, then reboot.

P
Peter, 2019-03-29
@petermzg

https://stackoverflow.com/questions/35233182/how-c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question