Properties · Methods · Demos · Examples
Declaration
TIEResourceExtractor = class;
Description
A class to extract resources from a PE files like EXE, DLL, OCX, ICL, BPL, etc.
Supported resources include Icons, Bitmaps, Cursors and other image resources.
| Demos\InputOutput\ResourceLoader\ResourceLoader.dpr |
// Extract the first icon in Windows Explorer
re := TIEResourceExtractor.Create('C:\Windows\Explorer.exe');
try
buffer := re.GetBuffer( 'Icon', 'INTRESOURCE:1', bufferLen );
ImageEnView1.IO.Params.IsResource := True;
if ImageEnView1.IO.LoadFromBuffer( buffer, bufferLen ) then
ImageEnView1.IO.SaveToFile( 'D:\Explorer.ico' );
finally
re.Free;
end;
// Load resource 143 in "Bitmap" from current application
var
re: TIEResourceExtractor;
buffer: pointer;
bufferLen: integer;
begin
re := TIEResourceExtractor.Create( Application.ExeName );
try
buffer := re.GetBuffer('Bitmap', 'INTRESOURCE:143', bufferLen);
ImageEnView1.IO.Params.IsResource := True;
ImageEnView1.IO.LoadFromBuffer(buffer, bufferLen, ioBMP);
finally
re.Free;
end;
end;
PropertiesMethodsSee Also
◼LoadFromResource◼LoadFromResource◼LoadFromResource