Group: Registry - Library: advapi32
The RegCreateKeyEx function creates the specified registry key. If the key already exists, the function opens it.
Class library providing access to the System Registry
LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
);
DECLARE INTEGER RegCreateKeyEx IN advapi32;
INTEGER hKey,;
STRING lpSubKey,;
INTEGER Reserved,;
STRING lpClass,;
INTEGER dwOptions,;
INTEGER samDesired,;
INTEGER lpSecurityAttributes,;
INTEGER @ phkResult,;
INTEGER @ lpdwDisposition
hKey [in] Handle to an open key.
lpSubKey [in] Pointer to a null-terminated string specifying the name of a subkey that this function opens or creates.
Reserved Reserved; must be zero.
lpClass [in] Pointer to a null-terminated string that specifies the class (object type) of this key.
dwOptions [in] This parameter can be one of predefined values.
samDesired [in] Access mask that specifies the access rights for the key.
lpSecurityAttributes [in] Pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes.
phkResult [out] Pointer to a variable that receives a handle to the opened or created key.
lpdwDisposition [out] Pointer to a variable that receives a disposition value.
If the function succeeds, the return value is ERROR_SUCCESS (0).
See also RegCloseKey, RegDeleteKey, RegSaveKey, RegOpenKeyEx.