关于MOBILE注册表操作.
在注册修改一个指定值.
用以下代码,修成了键值成了乱码.
把REG_SZ换成其他的也不行.请问是为什么?
char* dwReg;
HKEY hKEY;
LPCTSTR Rgspath = TEXT("\\Software\\Microsoft\\Shell\\Keys\\40C2");
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,Rgspath,0L,KEY_WRITE, &hKEY);
dwReg = "\\Program Files\\Barcode Reader\\GmediaHotkeyS.exe,0";
ret = RegSetValueEx(hKEY,TEXT("Icon"),0,REG_SZ,(unsigned char*)dwReg,strlen(dwReg)+1);
在注册修改一个指定值.
用以下代码,修成了键值成了乱码.
把REG_SZ换成其他的也不行.请问是为什么?
char* dwReg;
HKEY hKEY;
LPCTSTR Rgspath = TEXT("\\Software\\Microsoft\\Shell\\Keys\\40C2");
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,Rgspath,0L,KEY_WRITE, &hKEY);
dwReg = "\\Program Files\\Barcode Reader\\GmediaHotkeyS.exe,0";
ret = RegSetValueEx(hKEY,TEXT("Icon"),0,REG_SZ,(unsigned char*)dwReg,strlen(dwReg)+1);
RegCloseKey(hKEY);
应该是这样吧:
ret = RegSetValueEx(hKEY,TEXT("Icon"),0,REG_SZ,(unsigned char*)&dwReg,strlen(dwReg)+1);