Make your own free website on Tripod.com

KeyBoard Function in Windows95


This is small unit for the keyboard in Windows95.

Using the unit

Set Language to Arabic:
        SetLanguage (ARABIC);
Set Language to English:
        SetLanguage (English);
Get Current Language:
        Current:= GetLanguage;
Change the actvie Language:
        ChangeLanguage;
unit KeyBoard;

interface

uses
  Windows,SysUtils;

type
 TLanguage=(Arabic, English);

procedure SetLanguage (Lan:TLanguage) ;
function GetLanguage:TLanguage ;
procedure ChangeLanguage;

implementation

procedure SetLanguage (Lan:TLanguage) ;
begin
 if Lan= Arabic
    then LoadKeyBoardLayout ( '00000401', KLF_ACTIVATE)
    else LoadKeyBoardLayout ( '00000409', KLF_ACTIVATE);
end;

function GetLanguage:TLanguage ;
var
 p:array[0..100] of char;
begin
 GetKeyboardlayoutname(p);
 if StrPas(p) = '00000401'
    then GetLanguage:= Arabic
    else GetLanguage:= English;
end;

procedure ChangeLanguage;
begin
 ActivateKeyBoardLayout ( HKL_NEXT, 0);
end;

end.
 
BACK