Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Switch Keyboard for your application Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
21-Jan-03
Category
Win API
Language
Delphi 2.x
Views
85
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

Switch Keyboard for your application

Answer:

Solve 1:

Following code will activate 'Greek' Keyboard Layout for the application.

1   var
2     LangIdentifier: string;
3   begin
4     LangIdentifier := '00000408'; //'0000408' is the Language Identifier for Greek
5     LoadKeyboardLayout(PChar(LangIdentifier), KLF_ACTIVATE);
6   end;


PS: This would only Load the Keyboard Layouts which are installed on that very 
machine otherwise there would be no affect. 


Solve 2:

If you want to change a current keyboard layout, you can: 

1

7   var
8     lang: HKL;
9     lang := LoadKeyboardLayout(pcKeyboard, 0);
10    SetActiveKeyboardLayout(lang);


2

LoadKeyboardLayout(pcKeyboard, KLF_ACTIVATE);

where pcKeyboard is: 

'00000409' - english 
'00000419' - russian 
'00000422' - ukrainian 
'00000407' - german 
'0000040C' - french 
'00000410' - italian 
'00000416' - portuguese 
'0000040A' - spanish 

... (for more information view a language consts in windows.pas) 

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC