
This section provides the definitions for the registry functions.
DWORD SHDeleteEmptyKey(
HKEY hkey,
LPCTSTR pszSubKey
);
Deletes an empty key and all of its descendants. The function will remove the key and all of the key's associated values from the registry.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Microsoft® Windows® 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Microsoft® Windows NT® only)
|
| HKEY_USERS
|
- pszSubKey
- Address of a null-terminated string specifying the name of the key to delete.
Note The specified empty key must not contain any subkeys or values.
DWORD SHDeleteKey(
HKEY hkey,
LPCTSTR pszSubKey
);
Deletes a subkey and all its descendants. The function will remove the key and all of the key's values from the registry.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszSubKey
- Address of a null-terminated string specifying the name of the key to delete.
Windows 95: This function deletes a subkey and all its descendants.
Windows NT: The specified key must not contain any subkeys.
DWORD SHDeleteValue(
HKEY hkey,
LPCTSTR pszSubKey,
LPCTSTR pszValue
);
Deletes a named value from the specified registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszSubKey
- Address of a null-terminated string specifying the name of the subkey for which to change the value.
- pszValue
- Address of the value to be deleted.
DWORD SHEnumKeyEx(
HKEY hkey,
DWORD dwIndex,
LPTSTR pszName,
LPDWORD pcchName
);
Enumerates the subkeys of the specified open registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- dwIndex
- Specifies the index of the subkey to retrieve. This parameter should be zero for the first call and incremented for subsequent calls.
- pszName
- Address of a character buffer that receives the enumerated key name.
- pcchName
- Address of a DWORD that, on entry, contains the size of the buffer at pszName. On exit, this contains the number of characters that were copied to pszName.
DWORD SHEnumValue(
HKEY hkey,
DWORD dwIndex,
LPTSTR pszValueName,
LPDWORD pcchValueName,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData
);
Enumerates the values of the specified open registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- dwIndex
- Specifies the index of the value to retrieve. This parameter should be zero for the first call and incremented for subsequent calls.
- pszValueName
- Address of a character buffer that receives the enumerated value name. The size of this buffer is specified in pcchVlaueName.
- pcchValueName
- Address of a DWORD that, on entry, contains the size of the buffer at pszValueName. On exit, this contains the number of characters that were copied to pszValueName.
- pdwType
- Address of a DWORD that receives the data type of the value. These are the same values as those described under the lpType parameter of RegEnumValue.
- pvData
- Address of a buffer that receives the data for the value entry. The size of this buffer is specified in pcbData. This parameter can be NULL if the data is not required.
- pcbData
- Address of a DWORD that, on entry, contains the size of the buffer at pvData. On exit, this contains the number of bytes that were copied to pvData.
DWORD SHGetValue(
HKEY hkey,
LPCTSTR pszSubKey,
LPCTSTR pszValue,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData
);
Retrieves a registry value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszSubKey
- Address of a null-terminated string that specifies the name of the subkey from which to get the value.
- pszValue
- Address of the value.
- pdwType
- Type of value. For more information, see HKEY_TYPE.
- pvData
- Address of the destination data buffer.
- pcbData
- Size of the destination data buffer.
Note If your application must set/get a series of values in the same key, it is better to open the key once and set/get the values with the regular Microsoft® Win32® registry functions rather than use this function repeatedly.
DWORD SHSetValue(
HKEY hkey,
LPCTSTR pszSubKey,
LPCTSTR pszValue,
DWORD dwType,
LPCVOID pvData,
DWORD cbData
);
Sets the value of a registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszSubKey
- Address of a null-terminated string that specifies the name of the subkey with which a value is associated. This can be NULL or a pointer to an empty string. In this case, the value will be added to the key identified by the hKey parameter.
- pszValue
- Address of a null-terminated string that specifies the value.
- dwType
- Type of data to be stored. This parameter must be the REG_SZ type. For more information, see HKEY_TYPE.
- pvData
- Address of a null-terminated string that contains the value to set for the specified key.
- cbData
- Length, in bytes, of the string pointed to by the pvData parameter, not including the terminating null character.
IStream* SHOpenRegStream(
HKEY hkey,
LPCTSTR pszSubkey,
LPCTSTR pszValue,
DWORD grfMode
);
Opens a registry value and supplies an IStream interface that can be used to read from or write to the value.
- Returns the address of an IStream interface if successful, or NULL otherwise. The calling application is responsible for calling this interface's Release method when the IStream object is no longer needed.
- hkey
- Handle to the key that is currently open.
- pszSubkey
- Address of a null-terminated string that specifies the name of the subkey.
- pszValue
- Address of the value to be accessed.
- grfMode
- Type of access for the stream. This can be one of the following values:
| STGM_READ
| Open the stream for reading.
|
| STGM_WRITE
| Open the stream for writing.
|
| STGM_READWRITE
| Open the stream for reading and writing.
|
DWORD SHQueryInfoKey(
HKEY hkey,
LPDWORD pcSubKeys,
LPDWORD pcchMaxSubKeyLen,
LPDWORD pcValues,
LPDWORD pcchMaxValueNameLen
);
Retrieves information about a specified registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pcSubKeys
- Address of a DWORD that receives the number of subkeys under the specified key.
- pcchMaxSubKeyLen
- Address of a DWORD that receives the number of characters in the name of the subkey with the largest name.
- pcValues
- Address of a DWORD that receives the number of values under the specified key.
- pcchMaxValueNameLen
- Address of a DWORD that receives the number of characters in the name of the value with the largest name.
DWORD SHQueryValueEx(
HKEY hkey,
LPCTSTR pszValue,
LPDWORD pdwReserved,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData
);
Opens a registry key and queries it for a specific value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hkey
- Handle to the currently open key, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszValue
- Address of the null-terminated string that contains the name of the value to be queried.
- pdwReserved
- Reserved; must be null.
- pdwType
- Address of the variable that receives the key's value type. For more information, see HKEY_TYPE.
- pvData
- Address of the buffer that receives the value's data. This parameter can be NULL if the data is not required.
- pcbData
- Address of the variable that specifies the size, in bytes, of the buffer pointed to by the pvData parameter. When the function returns, this variable contains the size of the data copied to pvData.
LONG SHRegCreateUSKey(
LPCTSTR pszPath,
REGSAM samDesired,
HUSKEY hRelativeUSKey,
PHUSKEY phNewUSKey,
DWORD dwFlags
);
Creates or opens a user-specific registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- pszPath
- Address of a character buffer that contains the registry path of the key to be created or opened.
- samDesired
- Desired security access. For more information on security access, see REGSAM.
- hRelativeUSKey
- Data that indicates which type of HUSKEY to create.
- phNewUSKey
- Address of an HUSKEY that receive the handle to the new key.
- dwFlags
- Base key under which the key should be opened. This can be one or more of the following values:
| SHREGSET_HKCU
| Create/open the key under HKEY_CURRENT_USER.
|
| SHREGSET_HKLM
| Create/open the key under HKEY_LOCAL_MACHINE.
|
| SHREGSET_DEFAULT
| Create/open the key under both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE.
|
LONG SHRegDeleteEmptyUSKey
(HUSKEY hUSKey,
LPCSTR pszValue,
SHREGDEL_FLAGS delRegFlags
);
Deletes an empty user-specific registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hUSKey
- Handle to the currently open user-specific key.
- pszValue
- Address of the null-terminated string that specifies the empty user-defined registry key to be deleted.
- delRegFlags
- One of the SHREGDEL_FLAGS that specifies from which base key the key will be deleted.
See also SHRegDeleteUSValue
LONG SHRegDeleteUSValue(
HUSKEY hUSKey,
LPCTSTR pszValue,
SHREGDEL_FLAGS delRegFlags
);
Deletes a user-specific registry value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hUSKey
- Handle to the currently open user-specific key.
- pszValue
- Address of the null-terminated string that names the value to remove.
- delRegFlags
- One of the SHREGDEL_FLAGS that specifies from which base key the value will be deleted.
See also SHRegDeleteEmptyUSKey
DWORD SHRegEnumUSKey(
HUSKEY hUSKey,
DWORD dwIndex,
LPSTR pszName,
LPDWORD pcchName,
SHREGENUM_FLAGS enumRegFlags
);
Enumerates the subkeys of a user-specific key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hUSKey
- Handle to the currently open user-specific key.
- dwIndex
- Specifies the index of the subkey to retrieve. This parameter should be zero for the first call and incremented for subsequent calls.
- pszName
- Address of a character buffer that receives the enumerated key name.
- pcchName
- Address of a DWORD that, on entry, contains the size of the buffer at pszName. On exit, this contains the number of characters that were copied to pszName.
- enumRegFlags
- One of the SHREGENUM_FLAGS that specifies the base key in which the enumeration should take place.
DWORD SHRegEnumUSValue(
HUSKEY hUSkey,
DWORD dwIndex,
LPTSTR pszValueName,
LPDWORD pcchValueNameLen,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData,
SHREGENUM_FLAGS enumRegFlags
);
Enumerates the values of the specified user-specific registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hUSKey
- Handle to the currently open user-specific key.
- dwIndex
- Specifies the index of the value to retrieve. This parameter should be zero for the first call and incremented for subsequent calls.
- pszValueName
- Address of a character buffer that receives the enumerated value name. The size of this buffer is specified in pcchValueName.
- pcchValueNameLen
- Address of a DWORD that, on entry, contains the size of the buffer at pszValueName. On exit, this contains the number of characters that were copied to pszValueName.
- pdwType
- Address of a DWORD that receives the data type of the value. These are the same values as those described under the lpType parameter of RegEnumValue.
- pvData
- Address of a buffer that receives the data for the value entry. The size of this buffer is specified in pcbData. This parameter can be NULL if the data is not required.
- pcbData
- Address of a DWORD that, on entry, contains the size of the buffer at pvData. On exit, this contains the number of bytes that were copied to pvData.
- enumRegFlags
- One of the SHREGENUM_FLAGS that specifies the base key in which the enumeration should take place.
LONG SHRegGetUSValue(
LPCTSTR pszSubKey,
LPCTSTR pszValue,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData,
BOOL fIgnoreHKCU,
LPVOID pvDefaultData,
DWORD dwDefaultDataSize
);
Retrieves a user-specific registry value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- pszSubKey
- Handle to the currently open subkey, or any of the following predefined, reserved handle values:
| HKEY_CURRENT_USER
|
| HKEY_CURRENT_USER_RELATIVE
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_LOCAL_MACHINE_RELATIVE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
- pszValue
- Address of the null-terminated string that specifies the name of the value.
- pdwType
- Type of data to be stored. This parameter must be the REG_SZ type. For more information, see HKEY_TYPE.
- pvData
- Address of a null-terminated string that contains the value to set for the specified key.
- pcbData
- Length, in bytes, of the string pointed to by the pvData parameter, not including the terminating null character.
- fIgnoreHKCU
- Variable that indicates whether to ignore HKCU and bring HKLM up to date.
- pvDefaultData
- Address of the default data.
- dwDefaultDataSize
- Length, in bytes, of the default data.
LONG SHRegOpenUSKey(
LPCTSTR pszPath,
REGSAM samDesired,
HUSKEY hRelativeUSKey,
PHUSKEY phNewUSKey,
BOOL fIgnoreHKCU
);
Opens a user-specific registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- pszPath
- Handle to the currently open HKEY, or any of the following predefined handle values:
| HKEY_CURRENT_USER
|
| HKEY_CURRENT_USER_RELATIVE
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_LOCAL_MACHINE_RELATIVE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
- samDesired
- Desired security access. For more information on security access, see REGSAM.
- hRelativeUSKey
- Data that indicates which type of HUSKEY to create.
- phNewUSKey
- Address of a HUSKEY value that receives the new key handle.
- fIgnoreHKCU
- Variable that indicates whether to ignore HKCU and bring HKLM up to date.
DWORD SHRegQueryInfoUSKey(
HUSKEY hUSKey,
LPDWORD pcSubKeys,
LPDWORD pcchMaxSubKeyLen,
LPDWORD pcValues,
LPDWORD pcchMaxValueNameLen
);
Retrieves information about a specified user-specific registry key.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a textual description of the error.
- hUSKey
- Handle to the user-specific key that is currently open.
- pcSubKeys
- Address of a DWORD that receives the number of subkeys under the specified key.
- pcchMaxSubKeyLen
- Address of a DWORD that receives the number of characters in the largest subkey name.
- pcValues
- Address of a DWORD that receives the number of values under the specified key.
- pcchMaxValueNameLen
- Address of a DWORD that receives the number of characters in the largest value name.
LONG SHRegQueryUSValue(
HUSKEY hUSKey,
LPCTSTR pszValue,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData,
BOOL fIgnoreHKCU,
LPVOID pvDefaultData,
DWORD dwDefaultDataSize
);
Retrieves the type and data for a specified name associated with an open USKEY.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hUSKey
- Handle to the currently open USKEY, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszValue
- Address of the null-terminated string that contains the name of the value to be queried.
- pdwType
- Address of the variable that receives the key's value type. For more information, see HKEY_TYPE.
- pvData
- Address of the buffer that receives the value's data. This parameter can be NULL if the data is not required.
- pcbData
- Address of the variable that specifies the size, in bytes, of the buffer pointed to by the pvData parameter. When the function returns, this variable contains the size of the data copied to pvData.
- fIgnoreHKCU
- Variable to indicate whether to ignore HKCU and bring HKLM up to date.
- pvDefaultData
- Address of the default data.
- dwDefaultDataSize
- Length, in bytes, of the default data.
LONG SHRegSetUSValue(
LPCTSTR pszSubKey,
LPCTSTR pszValue,
DWORD dwType,
LPVOID pvData,
DWORD cbData,
DWORD dwFlags
);
Sets a user-specific registry value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- pszSubKey
- Handle to the currently open subkey, or any of the following predefined handle values:
| HKEY_CURRENT_USER
|
| HKEY_CURRENT_USER_RELATIVE
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_LOCAL_MACHINE_RELATIVE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
- pszValue
- Address of the null-terminated string that specifies the name of the value.
- dwType
- Type of data to be stored. This parameter must be the REG_SZ type. For more information, see HKEY_TYPE.
- pvData
- Address of a null-terminated string that contains the value to be set for the specified key.
- cbData
- Length, in bytes, of the string pointed to by the pvData parameter, not including the terminating null character.
- dwFlags
- Indicates whether to create/open HKCU, HKLM, or both.
Note If your code involves setting a series of values in the same key, rather than use this function repeatedly, it is better to open the key once and then call SHRegWriteUSValue.
LONG SHRegWriteUSValue(
HUSKEY hUSKey,
LPCTSTR pszValue,
DWORD dwType,
LPVOID pvData,
DWORD cbData,
DWORD dwFlags
);
Writes a user-specific registry value.
- Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
- hUSKey
- Handle to the currently open USKEY, or any of the following predefined values:
| HKEY_CLASSES_ROOT
|
| HKEY_CURRENT_CONFIG
|
| HKEY_CURRENT_USER
|
| HKEY_DYN_DATA (Windows 95 only)
|
| HKEY_LOCAL_MACHINE
|
| HKEY_PERFORMANCE_DATA (Windows NT only)
|
| HKEY_USERS
|
- pszValue
- Address of the null-terminated string that specifies the name of the value.
- dwType
- Type of data to be stored. This parameter must be the REG_SZ type. For more information, see HKEY_TYPE.
- pvData
- Address of a null-terminated string that contains the value to be set for the specified key.
- cbData
- Length, in bytes, of the string pointed to by the pvData parameter, not including the terminating null character.
- dwFlags
- Indicates whether to create/open HKCU, HKLM, or both.
typedef enum
{
SHREGDEL_DEFAULT = 0x00000000,
SHREGDEL_HKCU = 0x00000001,
SHREGDEL_HKLM = 0x00000010,
SHREGDEL_BOTH = 0x00000011,
} SHREGDEL_FLAGS;
Provides a set of values that indicate from which base key an item will be deleted.
- SHREGDEL_DEFAULT
- Deletes from HKEY_CURRENT_USER, or, if the specified item is not found under HKEY_CURRENT_USER, deletes from HKEY_LOCAL_MACHINE.
- SHREGDEL_HKCU
- Enumerates from HKEY_CURRENT_USER only.
- SHREGDEL_HKLM
- Enumerates under HKEY_LOCAL_MACHINE only.
- SHREGDEL_BOTH
- Deletes from both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE.
typedef enum{
SHREGENUM_DEFAULT = 0x00000000,
SHREGENUM_HKCU = 0x00000001,
SHREGENUM_HKLM = 0x00000010,
SHREGENUM_BOTH = 0x00000011,
} SHREGENUM_FLAGS;
Provides a set of values that indicate the base key that will be used for an enumeration.
- SHREGENUM_DEFAULT
- Enumerates under HKEY_CURRENT_USER, or, if the specified item is not found in HKEY_CURRENT_USER, enumerates under HKEY_LOCAL_MACHINE.
- SHREGENUM_HKCU
- Enumerates under HKEY_CURRENT_USER only.
- SHREGENUM_HKLM
- Enumerates under HKEY_LOCAL_MACHINE only.
- SHREGENUM_BOTH
- Not used.
Data type used for specifying the security access attributes in the registry. A REGSAM value can be one or more of the following values:
- KEY_ALL_ACCESS
- Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_SUB_KEY, KEY_CREATE_LINK, and KEY_SET_VALUE access.
- KEY_CREATE_LINK
- Permission to create a symbolic link.
- KEY_CREATE_SUB_KEY
- Permission to create subkeys.
- KEY_ENUMERATE_SUB_KEYS
- Permission to enumerate subkeys.
- KEY_EXECUTE
- Permission for read access.
- KEY_NOTIFY
- Permission for change notification.
- KEY_QUERY_VALUE
- Permission to query subkey data.
- KEY_READ
- Combination of KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY access.
- KEY_SET_VALUE
- Permission to set subkey data.
- KEY_WRITE
- Combination of KEY_SET and KEY_CREATE_SUB_KEY access.
Data type used for specifying the type of a registry value. An HKEY_TYPE value can be one of the following values:
- REG_BINARY
- Binary data in any form.
- REG_DWORD
- 32-bit number.
- REG_DWORD_LITTLE_ENDIAN
- 32-bit number in little-endian format. This is equivalent to REG_DWORD.
In little-endian format, a multibyte value is stored in memory from the lowest byte (the "little end") to the highest byte. For example, the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format.
Windows NT and Windows 95 are designed to run on little-endian computer architectures. A user may connect to computers that have big-endian architectures, such as some UNIX systems.
- REG_DWORD_BIG_ENDIAN
- 32-bit number in big-endian format.
In big-endian format, a multibyte value is stored in memory from the highest byte (the "big end") to the lowest byte. For example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) in big-endian format.
- REG_EXPAND_SZ
- Null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a UNICODE or ANSI string, depending on whether you use the UNICODE or ANSI functions.
- REG_LINK
- Unicode symbolic link.
- REG_MULTI_SZ
- Array of null-terminated strings that are terminated by two null characters.
- REG_NONE
- No defined value type.
- REG_RESOURCE_LIST
- Device-driver resource list.
- REG_SZ
- Null-terminated string. It will be a Unicode or ANSI string, depending on whether you use the Unicode or ANSI functions.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.