Exportovat (0) Tisk
Rozbalit vše
EN
Tento obsah není k dispozici ve vašem jazyce, ale můžete využít tuto verzi v anglickém jazyce.
Toto téma nebylo dosud ohodnoceno - Ohodnotit toto téma

SHRegCreateUSKey function

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

Syntax


LSTATUS SHRegCreateUSKey(
  _In_      LPCTSTR pszPath,
  _In_      REGSAM samDesired,
  _In_opt_  HUSKEY hRelativeUSKey,
  _Out_     PHUSKEY phNewUSKey,
  _In_      DWORD dwFlags
);

Parameters

pszPath [in]

Type: LPCTSTR

A pointer to a null-terminated string that contains the subkey to be created or opened. If a value with this name is already present in the subkey, it will be opened.

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. The key will then be created under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER, depending the value of dwFlags.

phNewUSKey [out]

Type: PHUSKEY

A pointer to an HUSKEY that will receive the handle to the new key.

dwFlags [in]

Type: DWORD

The 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. Only creates a key if it is empty.

SHREGSET_FORCE_HKCU

Create/open the key under HKEY_CURRENT_USER. Creates a key even if it is not empty.

SHREGSET_HKLM

Create/open the key under HKEY_LOCAL_MACHINE. Only creates a key if it is empty.

SHREGSET_FORCE_HKLM

Create/open the key under HKEY_LOCAL_MACHINE. Creates a key even if it is not empty.

SHREGSET_DEFAULT

Create/open the key under both HKEY_CURRENT_USER (forced) and HKEY_LOCAL_MACHINE (only if empty). This flag is the equivalent of (SHREGSET_FORCE_HKCU | SHREGSET_HKLM).

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

If you want to write values to the new key, use SHRegWriteUSValue to write each value, passing the HUSKEY handle that is returned through phNewUSKey. When you have finished, close the user-specific registry key with SHRegCloseUSKey.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 4.71 or later)

Unicode and ANSI names

SHRegCreateUSKeyW (Unicode) and SHRegCreateUSKeyA (ANSI)

 

 

Byl tento obsah pro vás užitečný?
(Zbývající počet znaků: 1500)
Děkujeme za váš názor.

Obsah vytvořený komunitou

Přidat
Zobrazit:
© 2014 Microsoft. Všechna práva vyhrazena.