如何在注册表中创建项
注意是创建原来不存在的项 不是键值或数值
请附代码
问题点数:20、回复次数:2Top
1 楼zhangnanonnet(鱼欢)回复于 2004-08-04 14:55:58 得分 20
HKEY hKey;
DWORD dwDisp;
char sitename[30], keya[13], keyb[13], keyc[13], data[33], control[10];
DWORD sType,Reserved;
Reserved=0;
strcpy(sitename,"site");
RegCreateKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Asgcc\\Analyse\\DeviceMap",
0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,
&hKey,&dwDisp);
RegCloseKey(hKey);Top
2 楼lixiaosan(小三)回复于 2004-08-04 15:11:35 得分 0
RegCreateKeyEx
Requirements
Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winreg.h Coredll.lib
This function creates the specified key. If the key already exists in the registry, the function opens it.
A remote application interface (RAPI) version of this function exists, and it is called CeRegCreateKeyEx (RAPI).
LONG RegCreateKeyEx(
HKEY hKey,
LPCWSTR lpSubKey,
DWORD Reserved,
LPWSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
);
具体请查看msdn
Top




