使用C ++编辑注册表 [英] Using C++ to edit the registry
问题描述
我有一个有限的c ++背景,我想编辑注册表。例如,我想获取 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun
的值,然后检查是否0x20在它,然后如果是,从它的值减去0x20,然后写回(并杀死并重新启动explorer.exe,但我可以自己解决)。
$ b $
-
打开注册表:
a href =http://msdn.microsoft.com/en-us/library/ms724897%28VS.85%29.aspx> RegOpenKeyEx
-
查询值: RegQueryValueEx
/ *执行值为* /
-
将值设置回:RegSetValueEx
-
关闭注册表: RegCloseKey
I have a limited c++ background and I would like to edit the registry. For example, I want to grab the value of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun
and check to see if 0x20 is in it, and then if it is, subtract 0x20 from it's value and write it back (and kill and restart explorer.exe but I can figure that out on my own).
How would you do it?
Open the registry : RegOpenKeyEx
Query the value : RegQueryValueEx
/* do something with value*/
Set the value back : RegSetValueEx
close the registry : RegCloseKey
这篇关于使用C ++编辑注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!