下面的代码把一个Flash文件转换为exe文件 function SwfExe(S D F: string): string; //S = Source file (swf) //D = Destionation file (exe) //F = Flash Player var SourceStream DestinyStream LinkStream: TFileStream; flag: Cardinal; SwfFileSize: Integer; begin Result := something error; DestinyStream := TFileStreamCreate(D fmCreate); try LinkStream := TFileStreamCreate(F fmOpenRead or fmShareExclusive); try DestinyStreamCopyFrom(LinkStream ); finally LinkStreamFree; end; SourceStream := TFileStreamCreate(S fmOpenRead or fmShareExclusive); try DestinyStreamCopyFrom(SourceStream ); flag := $FA; DestinyStreamWriteBuffer(flag SizeOf(Integer)); SwfFileSize := SourceStreamSize; DestinyStreamWriteBuffer(SwfFileSize SizeOf(Integer)); Result := ; finally SourceStreamFree; end; finally DestinyStreamFree; end; end; procedure TFormButtonClick(Sender: TObject); begin SwfExe(c:\somefileswf c:\somefileexe c:\Program Files\Macromedia\Flash MX\Players\SAFlashPlayerexe); end; 有了这个你就可以制作自己的Flash贺卡了 |