🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by ���� Fri, 27 Oct 2006 01:00
KeyBoard Language
#2895
Author: ����
Date: Fri, 27 Oct 2006 01:00
6 lines
1008 bytes
Hi
I have 2 different language installed on my Win98 OS and Keyboard.
I want to know if there is a way (API maybe) to determine which language is
using right now
For example , is it English (En) right now or Japanese?
Thanks
Re: KeyBoard Language
#2897
Author: Vladimir Stefanovic
Date: Fri, 27 Oct 2006 17:24
37 lines
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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads