All pastes #204829 Raw Edit

activekeyboardlayout

public text v1 · immutable
#204829 ·published 2006-10-16 09:02 UTC
rendered paste body
// GET ALL AVAILABLE KEYBOARD LAYOUTS

procedure TForm1.GetKLList(List: TStrings);
var
  AList : array [0..9] of Hkl;
  AklName: array [0..255] of Char;
  i: Longint;
begin
  List.Clear;
  for i := 0 to GetKeyboardLayoutList(SizeOf(AList), AList) - 1 do
    begin
      GetLocaleInfo(LoWord(AList[i]), LOCALE_SLANGUAGE, AklName, SizeOf(AklName));
      List.AddObject(AklName, Pointer(AList[i]));
    end;
end;


procedure TForm1.ComboBox2Change(Sender: TObject);
begin
 with Sender as TComboBox do
  begin
    ActivateKeyboardLayout(Hkl(Items.Objects[ItemIndex]), 0);
  end;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
  GetKLList(ComboBox2.Items);
 
end;