Link to home
Start Free TrialLog in
Avatar of sa3q
sa3q

asked on

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

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
Avatar of Bryan Butler
Bryan Butler
Flag of United States of America image

Avatar of cup
cup

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
Avatar of sa3q

ASKER

english have id in long type=67699721  

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

that what i want
Avatar of jkr
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?
Hebrew is


MAKELANGID(LANG_HEBREW,SUBLANG_HEBREW_ISRAEL);

Open in new window

Similarly Russian would be

MAKELANGID(LANG_RUSSIAN,SUBLANG_DEFAULT);

There is no sublanguage for Russian.
Avatar of sa3q

ASKER

i want the long id only for the hebrew  any answer pass that  i will accept it
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

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
Ignore my last one.  From cup's excellent link:
Hebrew 1037 040d
So actually:
040d040d
hex
Avatar of sa3q

ASKER

thanks