delphi 10.2 创建并使用资源文件(一共22种格式,RCDATA是自定义格式)
2021-07-16 09:18
标签:net target phi free 资源文件 table key constant fas 参考:http://www.cnblogs.com/del/archive/2008/02/15/1069769.html http://blog.csdn.net/rznice/article/details/77934632 delphi 10.2 创建并使用资源文件(一共22种格式,RCDATA是自定义格式) 标签:net target phi free 资源文件 table key constant fas 原文地址:https://www.cnblogs.com/findumars/p/8207232.html windows支持以下资源格式:
//下面是 Windows 支持的资源格式:
RT_CURSOR = MakeIntResource(1);
RT_BITMAP = MakeIntResource(2);
RT_ICON = MakeIntResource(3);
RT_MENU = MakeIntResource(4);
RT_DIALOG = MakeIntResource(5);
RT_STRING = MakeIntResource(6);
RT_FONTDIR = MakeIntResource(7);
RT_FONT = MakeIntResource(8);
RT_ACCELERATOR = MakeIntResource(9);
RT_RCDATA = Types.RT_RCDATA; //MakeIntResource(10);
RT_MESSAGETABLE = MakeIntResource(11);
DIFFERENCE = 11;
RT_GROUP_CURSOR = MakeIntResource(DWORD(RT_CURSOR + DIFFERENCE));
RT_GROUP_ICON = MakeIntResource(DWORD(RT_ICON + DIFFERENCE));
RT_VERSION = MakeIntResource(16);
RT_DLGINCLUDE = MakeIntResource(17);
RT_PLUGPLAY = MakeIntResource(19);
RT_VXD = MakeIntResource(20);
RT_ANICURSOR = MakeIntResource(21);
RT_ANIICON = MakeIntResource(22);
虽然Windows 规定 RCDATA 用作自定义格式, 我们也可以自定义格式名称, 譬如本例(rc 文件):
file01 RCDATA "C:\Windows\notepad.exe"
fastp myfile res/ceshi.fr3 //自定义为 myfile 格式
从资源文件中提取并调用:
var
rs: TResourceStream;
begin
rs := TResourceStream.Create(HInstance, ‘file01‘, RT_RCDATA);
.....
rs.Free;
end;
//调用自定义格式的资源文件
var
rs: TResourceStream;
begin
rs := TResourceStream.Create(HInstance, ‘fastp‘, ‘myfile‘);
.....
rs.Free;
end;
文章标题:delphi 10.2 创建并使用资源文件(一共22种格式,RCDATA是自定义格式)
文章链接:http://soscw.com/index.php/essay/105954.html