|
@@ -222,6 +222,28 @@ namespace Global
|
|
|
free(old_locale);//还原区域设定;
|
|
|
}
|
|
|
|
|
|
+ int ReadReg(char* path, char* key, char* value)
|
|
|
+ {
|
|
|
+ HKEY hKey;
|
|
|
+ int ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0, KEY_QUERY_VALUE, &hKey);
|
|
|
+ if (ret != ERROR_SUCCESS)
|
|
|
+ {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ //读取KEY
|
|
|
+ DWORD dwType = REG_SZ; //数据类型
|
|
|
+ DWORD cbData = 256;
|
|
|
+ ret = RegQueryValueEx(hKey, key, NULL, &dwType, (LPBYTE)value, &cbData);
|
|
|
+ if (ret != ERROR_SUCCESS)
|
|
|
+ {
|
|
|
+ RegCloseKey(hKey);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ RegCloseKey(hKey);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
|
|
|
// 读取配置文件-预留;
|
|
|
void GetConfig()
|