网站首页  词典首页

请输入您要查询的函数:

 

术语 setlocaleinfo
释义 SetLocaleInfo
语法:
BOOL SetLocaleInfo(
__in LCID Locale,
__in LCTYPE LCType,
__in LPCTSTR lpLCData
);
SetLocaleInfo功能
设置在当前语言环境的用户覆盖部分项目的信息。此函数不设置系统默认值。
注意因为此函数修改了所有的应用程序,它应该只值要求的区域和语言选项控制面板,或类似的实用工具的功能。如果让一个国际更改系统参数,调用应用程序必须广播WM_SETTINGCHANGE消息,以免在其他应用程序的不稳定。
参数
区域设置 [in]
对于函数的ANSI版本,该用时使用的解释lpLCData信息的代码页的区域设置区域设置标识符。对于Unicode版本,此参数被忽略。
您可以使用MAKELCID宏创建一个区域设置标识符或使用下列预定义的值之一。
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
下面的自定义区域设置标识符也支持。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LCType [in]
信息类型的区域设置。对于有效的常量看到在GetLocaleInfo,GetLocaleInfoEx,和SetLocaleInfo LCType参数一起使用的“区域设置信息常数”一节常数。该应用程序只能指定一个每次通话的价值,但它可以使用二进制运算符来合并或与任何其他不变LOCALE_USE_CP_ACP。
lpLCData [in]
指向一个以NULL结尾的字符串包含区域信息来设置。该信息必须在特定的格式指定的常数。应用程序使用该函数的Unicode版本Unicode字符串,和一个ANSI版本ANSI字符串。
返回值
返回一个非零值如果成功,或否则为0。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_ACCESS_DISABLED_BY_POLICY。计算机的组策略或用户已禁止此操作。
ERROR_INVALID_ACCESS。访问代码是无效的。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
这个函数写入到注册表中,在那里集与一个特定的用户,而不是一个特定的应用程序关联的值。这些注册表值的影响由用户运行其他应用程序的行为。作为一项规则,应用程序应调用只有当用户明确要求改变了这种功能。注册表设置不应该改变单一应用的方便。
对于LCType参数,应用程序应设置LOCALE_USE_CP_ACP使用的语言环境,而不是代码页转换为字符串操作系统的ANSI代码页。
当此函数的ANSI版本,是使用一个Unicode只设置标识符,函数可以成功,因为操作系统使用系统代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
作为Windows Vista的LOCALE_SDATE和LOCALE_STIME常量已经过时。不要使用这些常量。使用LOCALE_SSHORTDATE和LOCALE_STIMEFORMAT代替。自定义区域设置,可能不会有在日期或时间格式:单一的,统一分隔符,例如,如“12月31日,2006”或“03:56 '23”可能是有效的格式。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
Unicode和ANSI namesSetLocaleInfoW(Unicode)和SetLocaleInfoA(ANSI)的
参见
国家语言支持
国家语言支持功能
GetLocaleInfo
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==SetLocaleInfo Function
Sets an item of information in the user override portion of the current locale. This function does not set the system defaults.
Caution Because this function modifies values for all applications, it should only be called by the regional and language options functionality of Control Panel, or a similar utility. If making an international change to system parameters, the calling application must broadcast the WM_SETTINGCHANGE message to avoid causing instabilities in other applications.
Syntax
BOOL SetLocaleInfo(
__in LCID Locale,
__in LCTYPE LCType,
__in LPCTSTR lpLCData
);
Parameters
Locale [in]
For the ANSI version of the function, the locale identifier of the locale with the code page used when interpreting the lpLCData information. For the Unicode version, this parameter is ignored.
You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
The following custom locale identifiers are also supported.
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LCType [in]
Type of locale information to set. For valid constants see "Constants Used in the LCType Parameter of GetLocaleInfo, GetLocaleInfoEx, and SetLocaleInfo" section of Locale Information Constants . The application can specify only one value per call, but it can use the binary OR operator to combine LOCALE_USE_CP_ACP with any other constant.
lpLCData [in]
Pointer to a null-terminated string containing the locale information to set. The information must be in the format specific to the specified constant. The application uses a Unicode string for the Unicode version of the function, and an ANSI string for the ANSI version.
Return Value
Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError , which can return one of the following error codes:
ERROR_ACCESS_DISABLED_BY_POLICY. The group policy of the computer or the user has forbidden this operation.
ERROR_INVALID_ACCESS. The access code was invalid.
ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
Remarks
This function writes to the registry, where it sets values that are associated with a particular user instead of a particular application. These registry values affect the behavior of other applications run by the user. As a rule, an application should call this function only when the user has explicitly requested the changes. The registry settings should not be changed for the convenience of a single application.
For the LCType parameter, the application should set LOCALE_USE_CP_ACP to use the operating system ANSI code page instead of the locale code page for string translation.
When the ANSI version of this function is used with a Unicode-only locale identifier, the function can succeed because the operating system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).
As of Windows Vista, the LOCALE_SDATE and LOCALE_STIME constants are obsolete. Do not use these constants. Use LOCALE_SSHORTDATE and LOCALE_STIMEFORMAT instead. A custom locale might not have a single, uniform separator character within the date or time format: for example, a format such as "12/31, 2006" or "03:56'23" might be valid.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
Unicode and ANSI namesSetLocaleInfoW (Unicode) and SetLocaleInfoA (ANSI)
See Also
National Language Support
National Language Support Functions
GetLocaleInfo
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd374049(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:15:23