SHRegOpenUSKey function
Applies to: desktop apps only
Opens a registry subkey in a user-specific subtree (HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE).
Syntax
LSTATUS SHRegOpenUSKey( __in LPCTSTR pszPath, __in REGSAM samDesired, __in_opt HUSKEY hRelativeUSKey, __out PHUSKEY phNewUSKey, __in BOOL fIgnoreHKCU );
Parameters
- pszPath [in]
-
Type: LPCTSTR
A pointer to a null-terminated string with the name of the subkey.
- samDesired [in]
-
Type: REGSAM
The desired security access. For more information on security access, see REGSAM.
- hRelativeUSKey [in, optional]
-
Type: HUSKEY
The key to be used as a base for relative paths. If pszPath is a relative path, the key it specifies will be relative to hRelativeUSKey. If pszPath is an absolute path, set hRelativeUSKey to NULL.
- phNewUSKey [out]
-
Type: PHUSKEY
A pointer to the handle of the opened key.
- fIgnoreHKCU [in]
-
Type: BOOL
The variable that specifies which key to look under. When set to TRUE, SHRegOpenUSKey ignores HKEY_CURRENT_USER and returns a value from HKEY_LOCAL_MACHINE.
Return value
Type: LSTATUS
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 retrieve a generic description of the error.
Requirements
|
Minimum supported client | Windows 2000 Professional, Windows XP |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | SHRegOpenUSKeyW (Unicode) and SHRegOpenUSKeyA (ANSI) |
Send comments about this topic to Microsoft
Build date: 3/7/2012