Article View: borland.public.cppbuilder.nativeapi
Article #2897Re: KeyBoard Language
From: Vladimir Stefanovic
Date: Fri, 27 Oct 2006 17:24
Date: Fri, 27 Oct 2006 17:24
37 lines
1866 bytes
1866 bytes
> For example , is it English (En) right now or Japanese?
Look for API:
GetKeyboardLayoutName()
--- simple example ---
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char KLID[KL_NAMELENGTH+1] = {0};
GetKeyboardLayoutName( KLID );
ShowMessage( KLID );
}
To set a speciffic keyboard layout, use: LoadKeyboardLayout()
You also may be interested in constants:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
I dont't want to push you but once you face with active keyboard language
and
Code Pages, especially on Win98, you may want to get the active code page:
AnsiString GetSysLanguage()
{
char buffer[5] = {0};
::GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTLANGUAGE , buffer,
5);
return AnsiString( buffer );
}
... or if it fits in some speciific code page 'group', API: GetACP()
--
Best Regards,
Vladimir Stefanovic
Technical Details
Message-ID:
<454240c5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45423440@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c194b68c5f957dcf X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.nativeapi References: <45423440@newsgroups.borland.com> Subject: Re: KeyBoard Language Date: Fri, 27 Oct 2006 19:24:21 +0200 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 89.216.236.148 Message-ID: <454240c5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1161969861 89.216.236.148 (27 Oct 2006 10:24:21 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail