These functions use a calling convention stdcall. You need to add that their declaration.
function SetCurrentConsoleFontEx(ConsoleOutput: THandle; MaximumWindow: BOOL;
ConsoleInfo: PCONSOLE_FONT_INFOEX): BOOL; stdcall;
external kernel32 name 'SetCurrentConsoleFontEx';
function GetCurrentConsoleFontEx(ConsoleOutput: THandle; MaximumWindow: BOOL;
ConsoleInfo: PCONSOLE_FONT_INFOEX): BOOL; stdcall;
external kernel32 name 'GetCurrentConsoleFontEx';
You should also check the return values of these API calls. For example, use Win32Checkwould be appropriate.
Aside, the challenge is CheckWin32Versionpointless. If the API functions that you import are not in kernel32.dll, then the program will not even load. You can use boot latency to get around this and support XP if you really need XP support.
, struct . const var .
function SetCurrentConsoleFontEx(ConsoleOutput: THandle; MaximumWindow: BOOL;
const ConsoleInfo: TCONSOLE_FONT_INFOEX): BOOL; stdcall;
external kernel32 name 'SetCurrentConsoleFontEx';
function GetCurrentConsoleFontEx(ConsoleOutput: THandle; MaximumWindow: BOOL;
var ConsoleInfo: TCONSOLE_FONT_INFOEX): BOOL; stdcall;
external kernel32 name 'GetCurrentConsoleFontEx';
, , , Delphi Unicode. . Delphi Unicode, Write.
Unicode Delphi, API Windows. , WriteConsoleW.
, , . API - UCS2, , , .
TOndrej , Unicode Write :
- UTF-8
SetConsoleOutputCP(CP_UTF8) - 8- UTF-8
Write UTF8Encode.
, , - UTF-16 BMP.