Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine the OS language 1

Status
Not open for further replies.

mibosoft

Programmer
Jul 23, 2002
106
SE
Hi,
For my multi language supported app, I would like to determine in run-time what language the Windows version has or possibly the regional settings used.
/Micael
 

? OS(1)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Tried that. It only gives me "Windows 5.00". ?sys(3004) gives me locale 1033 and that doesn't help me either.
 
normanbates;

Here is the translation for the codes returned by SYS(3004)
See the help screen for SYS(3005)

1029 Czech
1031 German
1033 English (Default)
1034 Spanish
1036 French
1040 Italian
1045 Polish
1046 Portuguese (Brazilian)
2070 Portuguese (Standard)

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Hi Ed,
Thanks but sys(3004) returns the Locale ID used by automation and ActiveX controls. It doesn't say if the user is running Finnish Win-XP.

 
normanbates;

Try this:

Code:
DECLARE SHORT GetSystemDefaultLangID IN kernel32
DECLARE SHORT GetUserDefaultLangID   IN kernel32
DECLARE SHORT GetSystemDefaultLCID   IN kernel32
DECLARE SHORT GetUserDefaultLCID     IN kernel32
DECLARE SHORT GetThreadLocale        IN kernel32

DECLARE INTEGER GetOEMCP IN kernel32
DECLARE INTEGER GetACP IN kernel32
DECLARE INTEGER GetKBCodePage IN user32

? "System Default LangID: ", GetSystemDefaultLangID()
? "User Default LangID:   ", GetUserDefaultLangID()
? "System Default LCID:   ", GetSystemDefaultLCID()
? "User Default LCID:     ", GetUserDefaultLCID()
? "Current Thread Locale: ", GetThreadLocale()
? "OEM code-page identifier:  ", GetOEMCP()
? "ANSI code-page identifier: ", GetACP()
? "Current code page (should be the same as GetOEMCP): ", GetKBCodePage()

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Micael;

Glad it worked for you! [smile]
And thanks for the star!

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top