vc写入注册表,电脑重启后,写入内容消失原因

来源:互联网 发布:2017正规淘宝代刷平台 编辑:程序博客网 时间:2024/06/06 01:50

REG_OPTION_NON_VOLATILE   This   key   is   not   volatile;   this   is   the   default.   The   information   is   stored   in   a   file   and   is   preserved   when   the   system   is   restarted.   The   RegSaveKey   function   saves   keys   that   are   not   volatile.  
把你的REG_OPTION_VOLATILE参数修改成REG_OPTION_NON_VOLATILE就行了

 

 

long lReturn=RegCreateKeyEx(m_hKey,lpSubKey,0L,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dw);

 

非常神奇