procedure TForm1.FormCreate(Sender: TObject);
begin
path:=ExtractFilePath(ParamStr(0));
flash1.Movie :=path+'player.swf';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
targetWnd:Thandle;
r :TRect;
point:TPoint;
begin
Flash1.SetVariable('_file',path+'1.mp3');
targetWnd := FindWindow('TForm1','天易love');
if targetWnd <> 0 then
begin
GetWindowRect(targetWnd,r);
getcursorpos(point);
setcursorpos(r.Left+96,r.Top+80);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0); // 模拟鼠标双击 stop_btn
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
setcursorpos(point.x,point.y);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
targetWnd:Thandle;
r :TRect;
point:TPoint;
begin
Flash1.SetVariable('_file',path+'2.mp3');
targetWnd := FindWindow('TForm1','天易love');
if targetWnd <> 0 then
begin
GetWindowRect(targetWnd,r);
getcursorpos(point);
setcursorpos(r.Left+96,r.Top+80);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
setcursorpos(point.x,point.y);
end;
end;