Title: Switch Between Language in XP
Question: Can i Switch Between language in XP?
Answer:
Uses ...,Shellapi
.
.
.
function MakeKeyboardLayout(PrimaryLanguage, SubLanguage: Integer): String;
begin
Result := IntToHex(PrimaryLanguage or (SubLanguage shl 10),
KL_NAMELENGTH - 1);
end;
function FarsiKeyboardLayout: String;
begin
Result := MakeKeyboardLayout(LANG_FARSI,SUBLANG_DEFAULT);
end;
function EnglishKeyboardLayout: String;
begin
Result := MakeKeyboardLayout(LANG_ENGLISH, SUBLANG_DEFAULT);
end;
procedure TForm1.FarsiKeyboard(Sender: TObject);
begin
if LoadKeyboardLayout(PChar(FarsiKeyboardLayout),
KLF_ACTIVATE or KLF_REORDER) = 0 then
MessageDlg(ErrMsgFarsiKeyboard, mtError, [mbOK], 0);
end;
procedure TForm1.EnglishKeyboard(Sender: TObject);
begin
LoadKeyboardLayout(PChar(EnglishKeyboardLayout),
KLF_ACTIVATE or KLF_REORDER);
end;
procedure TForm1.NextKeyboardActionExecute(Sender: TObject);
begin
ActivateKeyboardLayout(HKL_NEXT, 0);//Switch Between Language
end;