registry

C++: Getting registry value only gives first character [duplicate]

孤者浪人 提交于 2021-02-05 12:20:35
问题 This question already has answers here : C++ - getting null values in value read from registry (2 answers) RegSetValueEx Only shows writes first character (2 answers) c++ get registry key returns only one char (1 answer) Closed 2 years ago . I'm trying to get a string value from the registry, but I'm only getting the first letter. HKEY hKey; char gamePath[MAX_PATH]; if(RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\Blizzard Entertainment\\Warcraft III",0,KEY_READ,&hKey) == ERROR_SUCCESS) { DWORD

How can I know which HDMI port is plugged in?

耗尽温柔 提交于 2021-01-29 07:55:52
问题 I have a computer with a dual hdmi output. I would like to detect which one is plugged in when I connect a monitor to either to one of them. It can be either with the help of registry, powershell or C# code, or anything. As long as it's not C++. I've tried various wmi methods. Searched the registry for anything that would specify a hdmi port. But found nothing so far. This stackoverflow answer (Detect/identify the port (HDMI, other) the monitor is connected to in Windows 7/8/10 Win32 C++) is

Delete a Registry key using C#

倾然丶 夕夏残阳落幕 提交于 2021-01-28 12:09:47
问题 I am trying to delete a Registry key like this: RegistryKey oRegistryKey = Registry.CurrentUser.OpenSubKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts", true); oRegistryKey.DeleteSubKeyTree("."); But that is giving me an exception: Cannot delete a subkey tree because the subkey does not exist If I change DeleteSubKeyTree to DeleteSubKey , I receive a different exception: Registry key has subkeys and recursive removes are not supported by this method 回答1: Try this:

Add registry key to HKCU RunOnce for every user from Visual Studio setup project

不问归期 提交于 2021-01-28 03:09:56
问题 I need to install an application that will run once for any user that logs in who has a profile on a Windows installation. I don't need it to run for new users. I am using a Visual Studio 2010 Setup Project to create an MSI, and I am happy to make Custom Actions in C# to fiddle with the registry if the MSI registry stuff isn't flexible enough. I know how to add a registry value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce with the MSI, but that will only start the

C# DWORD and QWORD - signed and unsigned madness

半城伤御伤魂 提交于 2021-01-27 06:52:27
问题 I've noticed that DWord and QWord values when written to the Registry supposed to be Signed Integers, not Unsigned. This code will throw an exception if value is UInt64 or UInt32: registryKey.SetValue(name, value); According to MSDN DWORD is a 32-bit unsigned integer (range: 0 through 4294967295 decimal) https://msdn.microsoft.com/en-us/library/cc230318.aspx So, to write new DWORD value to the Registry I need to cast it to signed integer like so: UInt32 unsignedValue = (UInt32)someValue;

C# DWORD and QWORD - signed and unsigned madness

雨燕双飞 提交于 2021-01-27 06:51:59
问题 I've noticed that DWord and QWord values when written to the Registry supposed to be Signed Integers, not Unsigned. This code will throw an exception if value is UInt64 or UInt32: registryKey.SetValue(name, value); According to MSDN DWORD is a 32-bit unsigned integer (range: 0 through 4294967295 decimal) https://msdn.microsoft.com/en-us/library/cc230318.aspx So, to write new DWORD value to the Registry I need to cast it to signed integer like so: UInt32 unsignedValue = (UInt32)someValue;

C# DWORD and QWORD - signed and unsigned madness

自闭症网瘾萝莉.ら 提交于 2021-01-27 06:49:35
问题 I've noticed that DWord and QWord values when written to the Registry supposed to be Signed Integers, not Unsigned. This code will throw an exception if value is UInt64 or UInt32: registryKey.SetValue(name, value); According to MSDN DWORD is a 32-bit unsigned integer (range: 0 through 4294967295 decimal) https://msdn.microsoft.com/en-us/library/cc230318.aspx So, to write new DWORD value to the Registry I need to cast it to signed integer like so: UInt32 unsignedValue = (UInt32)someValue;

Enumerate registry subkeys in delphi

丶灬走出姿态 提交于 2021-01-22 04:27:05
问题 I'm attempting to install a driver on a client machine based on which version of MySQL is installed on the server and to do that I'd like to check the version on the server via registry key. That said, I need to enumerate the subkey(s) of HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB . There is usually just one key under this one and it is generally of the form: MySQL Server #.# , where # stands for a number. But because I don't know which value those are, is there a way to get the key and then I can

Enumerate registry subkeys in delphi

南楼画角 提交于 2021-01-22 04:26:13
问题 I'm attempting to install a driver on a client machine based on which version of MySQL is installed on the server and to do that I'd like to check the version on the server via registry key. That said, I need to enumerate the subkey(s) of HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB . There is usually just one key under this one and it is generally of the form: MySQL Server #.# , where # stands for a number. But because I don't know which value those are, is there a way to get the key and then I can

Changing Power Scheme settings through Registry instead of Control Panel in Windows 7

笑着哭i 提交于 2021-01-20 20:24:05
问题 I'd like to change the settings of a power scheme (say, go to sleep after 45 minutes instead of 30) through the registry, rather than the control panel, in Windows 7. I'd also like to turn hot keys off the same way. Any suggestions how I do it? 回答1: I suspect this would be non-trivial due to the complexity of the power management architecture (schemes etc) & its always better to go through an abstracted API rather than fiddling with the underlying configuration data. If you dont want to use