SHRegOpenUSKeyW function (shlwapi.h)

Opens a registry subkey in a user-specific subtree (HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE).

Syntax

LSTATUS SHRegOpenUSKeyW(
                 LPCWSTR pwzPath,
  [in]           REGSAM  samDesired,
  [in, optional] HUSKEY  hRelativeUSKey,
  [out]          PHUSKEY phNewUSKey,
  [in]           BOOL    fIgnoreHKCU
);

Parameters

pwzPath

TBD

[in] samDesired

Type: REGSAM

The desired security access. For more information on security access, see REGSAM.

[in, optional] hRelativeUSKey

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.

[out] phNewUSKey

Type: PHUSKEY

A pointer to the handle of the opened key.

[in] fIgnoreHKCU

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.

Remarks

Note

The shlwapi.h header defines SHRegOpenUSKey as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 4.71 or later)