Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Convert SWF to EXE using Delphi Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
18-Sep-03
Category
Multimedia
Language
Delphi 3.x
Views
158
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

Converting SWF to EXE using Delphi

Answer:

1   function Swf2Exe(S, D, F: string): string;
2   //S = Source file (swf)
3   //D = Destionation file (exe)
4   //F = Flash Player
5   var
6     SourceStream, DestinyStream, LinkStream: TFileStream;
7     flag: Cardinal;
8     SwfFileSize: integer;
9   begin
10    result := 'something error';
11    DestinyStream := TFileStream.Create(D, fmCreate);
12    try
13      LinkStream := TFileStream.Create(F, fmOpenRead or fmShareExclusive);
14      try
15        DestinyStream.CopyFrom(LinkStream, 0);
16      finally
17        LinkStream.Free;
18      end;
19  
20      SourceStream := TFileStream.Create(S, fmOpenRead or fmShareExclusive);
21      try
22        DestinyStream.CopyFrom(SourceStream, 0);
23        flag := $FA123456;
24        DestinyStream.WriteBuffer(flag, sizeof(integer));
25        SwfFileSize := SourceStream.Size;
26        DestinyStream.WriteBuffer(SwfFileSize, sizeof(integer));
27        result := '';
28      finally
29        SourceStream.Free;
30      end;
31    finally
32      DestinyStream.Free;
33    end;
34  end;
35  
36  procedure TForm1.Button1Click(Sender: TObject);
37  begin
38    Swf2Exe('c:\somefile.swf', 'c:\somefile.exe',
39      'c:\Program Files\Macromedia\Flash MX\Players\SA\FlashPlayer.exe');
40  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC