procedure TForm1.WriteResFile(YourPathAndFileExt,ResFile:string);
const
MYFILE='MYRESFILE';
var
sr: TSearchRec;
FileAttrs,FileCount: Integer;
filelist:tstrings;
path:string;
begin
path:=copy(YourPathAndFileExt,1,LastDelimiter('/',YourPathAndFileExt));
filelist:=tstringlist.create;
FileAttrs:=0;
FileCount:=1;
if FindFirst(YourPathAndFileExt, FileAttrs, sr) = 0 then
begin
repeat
filelist.Add(MYFILE+' '+MYFILE+IntToStr(FileCount)+' '+path+sr.Name);
inc(FileCount);
until FindNext(sr) <> 0;
FindClose(sr);
end;
filelist.savetofile(ResFile);
filelist.free;
end
调用:
WriteResFile('d:/*.gif','d:/myres.rc');//将d:/的所有gif文件都写入d:/myres.rc资源文件
然后
利用brcc32编译成.res就可以了