给你我的控件,要再处理一下不会是什么难事了吧
unit CoolFlash;
interface
uses
SysUtils, Messages, Classes, Controls, OleCtrls, ShockwaveFlashObjects_TLB,
Windows, Menus, Forms;
type
TCoolFlash = class (TShockwaveFlash)
private
FPlayerVersion: string;
FStrecth: Boolean;
function GetStrecth: Boolean;
function GetVersion: string;
procedure RButtonDown(var Msg: TWMRBUTTONDOWN);
message WM_RBUTTONDOWN;
procedure RButtonUp(var Msg: TWMRBUTTONUP);
message WM_RBUTTONUP;
procedure SetStrecth(AValue: Boolean);
procedure WhenKeyDown(var Msg: TWMKEYDOWN);
message WM_KEYDOWN;
procedure WhenKeyUp(var Msg: TWMKEYUP);
message WM_KEYUP;
procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd);
message WM_ERASEBKGND;
procedure WMReSize(var Msg: TWMSIZE);
message WM_SIZE;
public
constructor Create(AOwner: TComponent);
override;
procedure ShowAboutBox;
procedure Update;
override;
published
property Strecth: Boolean read GetStrecth write SetStrecth default True;
property Version: string read GetVersion;
property Movie stored True;
property Menu stored True;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('PIHOME', [TCoolFlash]);
end;
{
********************************** TCoolFlash **********************************
}
constructor TCoolFlash.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FPlayerVersion:=InttoStr((FlashVersion shr 16) and $00FF);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr(FlashVersion shr 24);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr(FlashVersion and $000000FF);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr((FlashVersion shr 8) and $0000FF);
FStrecth:=True;
end;
function TCoolFlash.GetStrecth: Boolean;
begin
Result:=FStrecth;
end;
function TCoolFlash.GetVersion: string;
begin
Result:=FPlayerVersion;
end;
procedure TCoolFlash.RButtonDown(var Msg: TWMRBUTTONDOWN);
begin
Msg.Result:=1;
end;
procedure TCoolFlash.RButtonUp(var Msg: TWMRBUTTONUP);
begin
Msg.Result:=1;
if Menu and Assigned(PopupMenu) then
with Mouse.CursorPosdo
PopupMenu.Popup(X,Y);
end;
procedure TCoolFlash.SetStrecth(AValue: Boolean);
begin
FStrecth:=AValue;
end;
procedure TCoolFlash.ShowAboutBox;
begin
MessageBox(Application.Handle,PChar('CoolFlash Ver 1.0'#13'程序设计: PIHOME'
+#13#13'基于 MacroMedia Flash ActiveX 控件 '#13'版本: '+Version
+#13'Macromedia Inc.'+#13'http://www.macromedia.com'),'关于...',
mb_OK+MB_ICONINFORMATION+MB_SYSTEMMODAL);
end;
procedure TCoolFlash.Update;
begin
inherited;
if Visible and (not (csDesigning in ComponentState)) then
do
ObjectVerb(-1);
end;
procedure TCoolFlash.WhenKeyDown(var Msg: TWMKEYDOWN);
begin
Msg.Result:=1;
end;
procedure TCoolFlash.WhenKeyUp(var Msg: TWMKEYUP);
begin
if Msg.CharCode<>vk_RButton then
Exit;
Msg.Result:=1;
if Menu and Assigned(PopupMenu) then
with Mouse.CursorPosdo
PopupMenu.Popup(X,Y);
end;
procedure TCoolFlash.WMEraseBkgnd(var Msg: TWMEraseBkgnd);
begin
Msg.Result:=1;
end;
procedure TCoolFlash.WMReSize(var Msg: TWMSIZE);
begin
if Visible and FStrecth and (not (csDesigning in ComponentState)) then
do
ObjectVerb(-1);
end;
end.