/ Published in: Delphi
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
procedure ExtractResource(ResourceName, FileName: string); begin ExtractResource(hInstance, ResourceName, Filename); end; procedure ExtractResource(hnd: Cardinal; ResourceName, FileName: string); var rStream: TResourceStream; fStream: TFileStream; begin if FindResource(hnd, PChar(ResourceName), RT_RCDATA) <> 0 then begin rStream := TResourceStream.Create (hnd, ResourceName, RT_RCDATA); try fStream := TFileStream.Create(FileName, fmCreate); try fStream.CopyFrom(rStream, 0); finally fStream.Free; end; finally rStream.Free; end; end; end;