[code]
Function tConsole.GetKeyboardLayout : TKeyboardLayout;
Var
pwszKLID : Array [0..KL_NameLength] of Char;
begin
FillChar(pwszKLID,sizeof(pwszKLID),#0);
if (GetKeyboardLayoutNameW(pwszKLID)) then
begin
FKeyboardLayout := StrToInt('$'+StrPas(pwszKLID));
end else
begin
FKeyboardLayout := _KeyboardLayout_de_DE;
end;
Result := FKeyboardLayout;
end;
[/code]
On the strtoint('$'+ .... line
(pwszKLID = ('0', '0', '0', '2', '0', '4', '0', '9', #0 #0)
range check error: Ply.Console.pas
[code] Function tConsole.GetKeyboardLayout : TKeyboardLayout; Var pwszKLID : Array [0..KL_NameLength] of Char; begin FillChar(pwszKLID,sizeof(pwszKLID),#0); if (GetKeyboardLayoutNameW(pwszKLID)) then begin FKeyboardLayout := StrToInt('$'+StrPas(pwszKLID)); end else begin FKeyboardLayout := _KeyboardLayout_de_DE; end; Result := FKeyboardLayout; end; [/code]
On the strtoint('$'+ .... line (pwszKLID = ('0', '0', '0', '2', '0', '4', '0', '9', #0 #0)
Solution see: https://en.delphipraxis.net/topic/9353-console-application-crt-unit-console-library/?do=findComment&comment=77878