i want long number of keyboardlayout  for  many language  can any body help?

sa3q
sa3q used Ask the Experts™
on
i want long number for english  and arabic and hebrew and rasha

like this what iwant i want only the number


this code in visual  basic  have the long numbers
if GetKeyboardLayout(0) = 67699721  then
     messagebox('Language', 'English')
elseif  GetKeyboardLayout(0) = 67189761
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
cup

Commented:
It is a lot easier if you work in hex.

First code is 04090409

Breaking this up - the top half is the language , the bottom half is the keyboard.  In this case top half 0409 is US English, bottom half is US English layout

The second number is 04013C01
401 = Arabic (Saudi)
3C01 = Arabic (Bahrain)

Have a look at http://www.science.co.il/Language/Locale-Codes.asp?s=codepage

Split the codes into what you want , language and keyboard wise and you will get the code.

Eg British English, French keyboard is 0409040c

Author

Commented:
english have id in long type=67699721  

i want the long type for arabic and hebrew and rasian only

that what i want
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

jkr
Top Expert 2012

Commented:
A the docs on 'GetKeyboardLayout()' (http://msdn.microsoft.com/en-us/library/ms646296(VS.85).aspx) state "The return value is the input locale identifier for the thread. The low word contains a Language Identifier for the input language and the high word contains a device handle to the physical layout of the keyboard.". So you basically need toe low word of the return value and compare that to the language Ids you want to examine (see http://msdn.microsoft.com/en-us/library/dd318693(VS.85).aspx - "Language Identifier Constants and Strings" for all possible layouts), e.g.
HKL hkl = GetKeyboardLayout(0);

DWORD dwLangId = LOWORD(hkl);

if (dwLangId == MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_UK)) {

  // UK layout
}

Open in new window

So, don't you have the hebrew from cup's excellent post?

The second number is 04013C01
0401 = Arabic (Saudi) - language
3C01 = Arabic (Bahrain) - keyboard?
jkr
Top Expert 2012

Commented:
Hebrew is


MAKELANGID(LANG_HEBREW,SUBLANG_HEBREW_ISRAEL);

Open in new window

cup

Commented:
Similarly Russian would be

MAKELANGID(LANG_RUSSIAN,SUBLANG_DEFAULT);

There is no sublanguage for Russian.

Author

Commented:
i want the long id only for the hebrew  any answer pass that  i will accept it
Top Expert 2012
Commented:
Well, that would be
HKL hkl = GetKeyboardLayout(0);

DWORD dwLangId = LOWORD(hkl);

if (dwLangId == MAKELANGID(LANG_HEBREW,SUBLANG_HEBREW_ISRAEL)) {

  // Hebrew layout
}

Open in new window

Ignore my last one.  From cup's excellent link:
Hebrew 1037 040d
So actually:
040d040d
hex

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial