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;
参考:http://www.cnblogs.com/del/archive/2008/02/15/1069769.html
http://blog.csdn.net/rznice/article/details/77934632
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。