RegLoadMUIStringA function

Loads the specified string from the specified key and subkey.

Syntax

LSTATUS RegLoadMUIStringA(
  HKEY    hKey,
  LPCSTR  pszValue,
  LPSTR   pszOutBuf,
  DWORD   cbOutBuf,
  LPDWORD pcbData,
  DWORD   Flags,
  LPCSTR  pszDirectory
);

Parameters

hKey

A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right. For more information, see Registry Key Security and Access Rights.

This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function. It can also be one of the following predefined keys:

HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

pszValue

The name of the registry value.

pszOutBuf

A pointer to a buffer that receives the string.

Strings of the following form receive special handling:

@[path]<i>dllname,-strID

The string with identifier strID is loaded from dllname; the path is optional. If the pszDirectory parameter is not NULL, the directory is prepended to the path specified in the registry data. Note that dllname can contain environment variables to be expanded.

cbOutBuf

The size of the pszOutBuf buffer, in bytes.

pcbData

A pointer to a variable that receives the size of the data copied to the pszOutBuf buffer, in bytes.

If the buffer is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to by pcbData. In this case, the contents of the buffer are undefined.

Flags

This parameter can be 0 or the following value.

Value Meaning
REG_MUI_STRING_TRUNCATE
0x00000001
The string is truncated to fit the available size of the pszOutBuf buffer. If this flag is specified, pcbData must be NULL.

pszDirectory

The directory path.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a system error code.

If the pcbData buffer is too small to receive the string, the function returns ERROR_MORE_DATA.

The ANSI version of this function returns ERROR_CALL_NOT_IMPLEMENTED.

Remarks

The RegLoadMUIString function is supported only for Unicode. Although both Unicode (W) and ANSI (A) versions of this function are declared, the RegLoadMUIStringA function returns ERROR_CALL_NOT_IMPLEMENTED. Applications should explicitly call RegLoadMUIStringW or specify Unicode as the character set in platform invoke (PInvoke) calls.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winreg.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See Also

Registry Functions