展开全部
截获鼠标点击事件即可~~~~
在窗体里放一个shockwaveflash控件,之后先定义函数
procedure TForm1.ApplicationEvents1ActionExecute(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_LBUTTONDOWN) and (Msg.hwnd = ShockwaveFlash1.handle) then
begin
showmessage('左键按下');
Handled := True;
end;
end;
然后再form的OnCreate事件下写一句代码
application.onmessage:=ApplicationEvents1ActionExecute;
运行你的程序~~~鼠标点击一下flash控件,即使你想要的结果哈~~~~
全部单元代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
ShockwaveFlash1: TShockwaveFlash;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ApplicationEvents1ActionExecute(var Msg: tagMSG; var Handled: Boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ApplicationEvents1ActionExecute(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_LBUTTONDOWN) and (Msg.hwnd = ShockwaveFlash1.handle) then
begin
showmessage('左键按下');
Handled := True;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.onmessage:=ApplicationEvents1ActionExecute;
end;
end.
在窗体里放一个shockwaveflash控件,之后先定义函数
procedure TForm1.ApplicationEvents1ActionExecute(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_LBUTTONDOWN) and (Msg.hwnd = ShockwaveFlash1.handle) then
begin
showmessage('左键按下');
Handled := True;
end;
end;
然后再form的OnCreate事件下写一句代码
application.onmessage:=ApplicationEvents1ActionExecute;
运行你的程序~~~鼠标点击一下flash控件,即使你想要的结果哈~~~~
全部单元代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, ShockwaveFlashObjects_TLB;
type
TForm1 = class(TForm)
ShockwaveFlash1: TShockwaveFlash;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ApplicationEvents1ActionExecute(var Msg: tagMSG; var Handled: Boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ApplicationEvents1ActionExecute(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_LBUTTONDOWN) and (Msg.hwnd = ShockwaveFlash1.handle) then
begin
showmessage('左键按下');
Handled := True;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.onmessage:=ApplicationEvents1ActionExecute;
end;
end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询