gpt4 book ai didi

delphi - 如何在 DelphiXE7 中列出所有 Windows 代码页标识符?

转载 作者:行者123 更新时间:2023-12-03 19:37:22 24 4
gpt4 key购买 nike

我需要在组合框中列出所有 Windows 代码页以供选择。
这将用于设置应用程序代码页。
我们如何列出所有 Windows 代码页标识符 在 DelphiXE7 中?

最佳答案

var
CPList: TStrings;

function CodePagesProc(CodePageString: PChar): BOOL; stdcall;
begin
CPList.Add(CodePageString);
Result := TRUE;
end;

procedure TFrmX.FormCreate(Sender: TObject);
begin
...
CPList := ComboBox1.Items;
CPList.BeginUpdate;
try
EnumSystemCodePages(@CodePagesProc, CP_SUPPORTED);
// EnumSystemCodePages will call CodePagesProc() repeatedly for each code page.
finally
CPList.EndUpdate;
end;
end;

引用:

EnumSystemCodePages function

http://www.devsuperpage.com/search/Articles.asp?ArtID=604277

http://www.delphipraxis.net/727316-post10.html

关于delphi - 如何在 DelphiXE7 中列出所有 Windows 代码页标识符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47016656/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com