Compartilhar via


GetLocaleInfo

This function retrieves information about a locale.

int GetLocaleInfo(
LCID Locale, 
LCTYPE LCType, 
LPTSTR lpLCData, 
int cchData ); 

Parameters

  • Locale
    [in] Specifies the locale to retrieve information for. This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values:

    Value Description
    LOCALE_SYSTEM_DEFAULT Default system locale.
    LOCALE_USER_DEFAULT Default user locale.
    LOCALE_NEUTRAL Default language-neutral locale.
  • LCType
    [in] Specifies one of the LCTYPE constants to indicate the type of information to be retrieved.

    All LCTYPE values are mutually exclusive, with the exception of LOCALE_NOUSEROVERRIDE. An application may use the binary-OR operator to combine LOCALE_NOUSEROVERRIDE with any other LCTYPE value. If passed such an LCType value, the function bypasses user overrides, and returns the system default value for the requested LCID.

  • lpLCData
    [out] Pointer to a buffer to receive the requested data.

  • cchData
    [in] Specifies the size, in characters, of the lpLCData buffer. If cchData is zero, the function returns the number of characters required to hold the information, and the buffer pointed to by lpLCData is not used.

Return Values

The number of bytes or characters written to the destination buffer, or, if the cchData parameter is zero, the number of characters required to hold the locale information indicates success. Zero indicates failure. To get extended error information, call GetLastError. Possible values for GetLastError include the following:

  • ERROR_INSUFFICIENT_BUFFER
  • ERROR_INVALID_FLAGS
  • ERROR_INVALID_PARAMETER

Remarks

The GetLocaleInfo function always retrieves information in text format. If the information is a numeric value, the function converts the number to text using decimal notation.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winnls.h   Coreloc.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MAKELCID

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.