procedure TFlashPlayFileFrm.MouseRightMessage(var Msg: TMsg;
var Handled: Boolean);
begin
if (Msg.message = WM_RBUTTONDOWN) and (Msg.hwnd = ShockwaveFlash.Handle) then
begin
Handled := True;
RightPM.Popup(Mouse.CursorPos.X,Mouse.CursorPos.y);
end;
end;
procedure TFlashPlayFileFrm.FormCreate(Sender: TObject);
var
hMenuHandle:Integer;
begin
hMenuHandle:=GetSystemMenu(Handle,False);
if (hMenuHandle<>0) then
DeleteMenu(hMenuHandle,SC_CLOSE,MF_BYCOMMAND);
Application.OnMessage:= MouseRightMessage;
end;
procedure TFlashPlayFileFrm.WMSYSCommand(var msg: TWMSYSCommand);
begin
if (Msg.CmdType = SC_MAXIMIZE) then
WindowMaximize
else
DefaultHandler(Msg);
end;
procedure TFlashPlayFileFrm.WindowMaximize;
begin
Setwindowlong(Handle,GWL_STYLE,Getwindowlong(Handle,GWL_STYLE)and not WS_CAPTION);
WindowState := wsMaximized;
end;
procedure TFlashPlayFileFrm.N7Click(Sender: TObject);
begin
SetWindowLong(Handle,GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) or WS_CAPTION);
WindowState := wsNormal;
end;
procedure TFlashPlayFileFrm.FormDestroy(Sender: TObject);
begin
ShockwaveFlash.FreeOnRelease;
end;
procedure TFlashPlayFileFrm.FormResize(Sender: TObject);
begin
ActiveControl := nil;
ActiveControl := ShockwaveFlash;
end;
procedure TFlashPlayFileFrm.N6Click(Sender: TObject);
begin
WindowMaximize;
end;
procedure TFlashPlayFileFrm.FormMouseDown(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
const
SC_DragMove: LongInt = $F012;
begin
ReleaseCapture;
SendMessage(ShockwaveFlash.Handle, WM_SYSCOMMAND, SC_DragMove, 0);
end;
procedure TFlashPlayFileFrm.CopySingleFrame;
begin
FlashPlayFileFrm.ShockwaveFlash.Stop;
CopyBitMap := TBitmap.Create;
try
CopyBitMap.Width := FlashPlayFileFrm.ShockwaveFlash.Width;
CopyBitMap.Height := FlashPlayFileFrm.ShockwaveFlash.Height;
FlashPlayFileFrm.ShockwaveFlash.PaintTo(CopyBitMap.Canvas.Handle,0,0);
if SavePictureDialog.Execute then
CopyBitMap.SaveToFile(SavePictureDialog.FileName+'.bmp');
finally
CopyBitMap.Free;
end;
end;
procedure TFlashPlayFileFrm.N4Click(Sender: TObject);
begin
CopySingleFrame;
end;
procedure TFlashPlayFileFrm.N1Click(Sender: TObject);
begin
FlashPlayerFrm.ControlPauseClick(Sender);
end;
procedure TFlashPlayFileFrm.N2Click(Sender: TObject);
begin
FlashPlayerFrm.ControlNextClick(Sender);
end;
procedure TFlashPlayFileFrm.N3Click(Sender: TObject);
begin
FlashPlayerFrm.ControlPreviousClick(Sender);
end;
procedure TFlashPlayFileFrm.N8Click(Sender: TObject);
begin
FlashPlayFileFrm.ShockwaveFlash.StopPlay;
FlashPlayFileFrm.ShockwaveFlash.Stop;
end;
procedure TFlashPlayFileFrm.N9Click(Sender: TObject);
begin
ShellAbout(Application.Handle,'SuperFlashPlayer 1.0','设计:张晶晶'+#13+'刀剑如梦软件创作室',Application.Icon.Handle);
end;
procedure TFlashPlayFileFrm.FormActivate(Sender: TObject);
begin
FlashPlayFileFrm.Left := (Screen.Width - FlashPlayFileFrm.Width) div 2;
FlashPlayFileFrm.Top := 0;
end;
procedure TFlashPlayFileFrm.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.hwnd=ShockwaveFlash.Handle)and(Msg.message=wm_Lbuttondown) then
begin
ReleaseCapture;
ShockwaveFlash.Perform(WM_SYSCOMMAND,$f012,0);
end;
end;