Link to home
Start Free TrialLog in
Avatar of jeroenlemaire
jeroenlemaire

asked on

howto get Windows system language from registry

Hi all,

I'm doing some development on office automatisation, and i ran into a little problem i can easily avoid, if only I can get the language of the Windows OS installed...  The windows OS's i use are Windows 2003 and Windows XP. Now i'm running them in Dutch, French and English.
I guess there must be a registry-key somewhere indicating the installed Windows language...
Can anyone help me on that?

Thanx in advance!
ASKER CERTIFIED SOLUTION
Avatar of Jase-Coder
Jase-Coder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeroenlemaire
jeroenlemaire

ASKER

can this function be called from VBA? if yes, can u tell me how?
you can call this function using VBA. take a look at http://vb.mvps.org/articles/ap199808.pdf
there is an article showing how to call this functon using vb
For those who might be interested in how to use this in VBA:

'declare the function to call from the kernel32
Private Declare Function GetSystemDefaultLangID Lib "kernel32" () As Long

Once you've done that, you can get the languageID in a string like this:
Dim LanguageID as Integer
LanguageID = CInt(CStr(Val("&H" & Right(Hex(GetSystemDefaultLangID()), 3))))

Thanks for getting me started Jase-coder!
The 250pts are for you!
Avatar of Danny Child
This key here
HKEY_USERS\.DEFAULT\Keyboard Layout\Preload
sets the default language for the login screen, which may answer your query

This link here shows the different country codes in use.
http://www.windowsitpro.com/Article/ArticleID/14867/14867.html

hth, Danny
this is not the system language, but the keyboard lay-out...
i guess your kinda off-topic here...