?
Solved

howto get Windows system language from registry

Posted on 2007-07-31
6
Medium Priority
?
10,828 Views
Last Modified: 2013-12-03
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!
0
Comment
Question by:jeroenlemaire
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 750 total points
ID: 19599083
Hi

you should use GetSystemDefaultLangID() this function returns a language ID and the list of return values can be found here:
http://msdn2.microsoft.com/en-us/library/ms776294.aspx
0
 
LVL 3

Author Comment

by:jeroenlemaire
ID: 19599100
can this function be called from VBA? if yes, can u tell me how?
0
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 19599300
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
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 3

Author Comment

by:jeroenlemaire
ID: 19599357
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!
0
 
LVL 23

Expert Comment

by:Danny Child
ID: 19599368
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
0
 
LVL 3

Author Comment

by:jeroenlemaire
ID: 19599374
this is not the system language, but the keyboard lay-out...
i guess your kinda off-topic here...
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question