我在使用WebBrowser浏览Flash文件时,如何禁用Flash播放器的菜单?
我在使用WebBrowser浏览Flash文件时,如何禁用Flash播放器的菜单?
procedure TMyForm.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message=WM_RBUTTONDOWN) and IsChild(WebBrowser1.Handle,Msg.hwnd) then
begin
PopupMenu1.Popup(Msg.pt.X,Msg.pt.Y);
Handled:=true;
end;
end;
procedure TForm1.FormMouseActivate(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y, HitTest: Integer;
var MouseActivate: TMouseActivate);
begin
if Button=mbRight then
begin
if (x >= WebBrowser1.Left) and
(x <= WebBrowser1.Left + WebBrowser1.Width ) and
(y >= WebBrowser1.Top) and
(y <= WebBrowser1.Top + WebBrowser1.Height ) then
MouseActivate := maNoActivateAndEat;
end;
end;