unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, OleCtrls, ShockwaveFlashObjects_TLB, StdCtrls;
type
TForm1 = class(TForm)
flash: TShockwaveFlash;
Timer1: TTimer;
Button1: TButton;
procedure FormResize(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormResize(Sender: TObject);
begin
form1.Timer1.Enabled:=true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
sendmessage(button1.handle,wm_keydown,vk_space,1);
sendmessage(button1.handle,wm_keyup,vk_space,1);
timer1.enabled:=false;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
sendmessage(flash.handle,wm_lbuttondown,0,0);
sendmessage(flash.handle,wm_lbuttonup,0,0);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
flash.Movie :='d:/screensave.swf';
end;
end.
注:button1设为不可见
奇怪:直接对FLASH SENDMESSAGE没用,而通过BUTTON转一下就OK了,气人