赞助

c++ 操作注册表

转载:http://www.cnblogs.com/cappuccino/p/4838712.html

转载:http://blog.csdn.net/tracyzhongcf/article/details/4076870

转载:http://blog.csdn.net/guowenyan001/article/details/6162729

 

 

使用RegSetValueEx函数

插入字符串(REG_SE):

TCHAR szTest[32];

wcsncpy(szTest, TEXT("test.dll"), 32);

int iLen = wcslen(szTest);

RegSetValueEx(hKey, TEXT("test"), 0, REG_SZ, (LPBYTE)szTest, sizeof(TCHAR)*iLen );  

 

插入整数(REG_DWORD):

DWORD dwValue = 1234; 
long setRes = RegSetValueEx (hKey, L"test", 0, REG_DWORD,(CONST BYTE*)&dwValue,sizeof(DWORD));

 

posted @ 2017-09-11 11:10  车臣  阅读(295)  评论(0编辑  收藏  举报