How To Get the Current User Locale ID in a VB EXE Without Restarting (217751)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q217751 SUMMARY
The Locale ID (LCID) is a 32-bit value that consists of a language ID plus a sort ID and other reserved bits. A language ID is a 16-bit value consisting of a primary language ID and a secondary language ID. After changes have been made to the Language setting in the Regional Settings applet, it is sometimes necessary to get the current user LCID value either in the IDE or within an application without closing down the application. This can be done by calling GetThreadLocale from within an ActiveX EXE server. The server creates its own thread and, by calling GetThreadLocale, the current value can be obtained.
Without using an out-of-process server, the value obtained by calling GetThreadLocale from within a standard EXE application might not be current. You might also see that the value does not get updated in the IDE.
Some of the API calls that use the LCID as a parameter are
GetLocaleInfo, GetTimeFormat, and GetDateFormat.
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbAPI kbhowto kbLocalSvr KB217751 kbAudDeveloper |
---|
|