Today, Delphi is one of the popular desktop programming tool. There are thousand even million programmer in this world using delphi as their favorit tool. This site try to collect the examples, tips and tricks of Delphi programming. We collect, test them and redistribute the collection of delphi programming for you.

Switch Keyboard Layout to Regional Language

Author: admin | Category: Tips and Tricks, Windows API

//This is delphi tips and trick how we can switch keyboard layout to our regional language.
//For this example we need to place Button1 (TButton) and Memo1 (TMemo) to the form painter
//Then use this code
//Run the application, click button1 then try to write anything on Memo1
 
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  LoadKeyboardLayout('00000419',KLF_ACTIVATE)
  //'00000419' is pcKeyboard parameter values for russian
end;
 
end.
 
{pcKeyboard parameter values for regional language
    '00000409' - english
    '00000419' - rusian
    '00000422' - ukrainan
    '00000407' - germain
    '0000040C' - french
    '00000410' - italian
    '00000416' - portuguese
    '0000040A' - spanish
   }
 

Tags: