ShockWaveFlash应用实例-简易SWF播放器
//编写工具:Delphi XE3 With Update2unit Unit1;interfaceuses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, StdCtrls, Buttons, OleCtrls, ShockwaveFlashObjects_TLB,
Vcl.ExtCtrls;type
TForm1 = class(TForm)
ShockwaveFlash1: TShockwaveFlash;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
OpenDialog1: TOpenDialog;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private procedure ShutDownMouse(var Msg: TMsg; var Handled: Boolean);
publicend;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
var
OpenName:String;
begin
OpenDialog1.Filter:= 'Flash文件(*.swf)';
if OpenDialog1.execute then
ShockwaveFlash1.Movie:=OpenDialog1.FileName;
ShockwaveFlash1.Play;
end;procedure TForm1.BitBtn2Click(Sender: TObject);
begin
ShockwaveFlash1.StopPlay;
end;procedure TForm1.ShutDownMouse(var Msg: TMsg; var Handled: Boolean);
begin
if (Msg.message = WM_RBUTTONDOWN) and (msg.hwnd = ShockwaveFlash1.Handle) then
Handled:= true;
end;
end.
页:
[1]