当我们';我们正在使用Flash!(德尔菲)
当我使用WebBrowser浏览flash文件时,如何禁用flash player的菜单?发送到WebBrowser的所有消息也会通过您的Delphi应用程序,因此通过使用TApplicationEvents组件并在WebBrowser句柄上的OnMessage事件中检查右键单击事件,或者它的任何子句柄(use)和set Handled,您应该能够阻止它 代码可能是这样的当我们';我们正在使用Flash!(德尔菲),flash,delphi,browser,right-click,Flash,Delphi,Browser,Right Click,当我使用WebBrowser浏览flash文件时,如何禁用flash player的菜单?发送到WebBrowser的所有消息也会通过您的Delphi应用程序,因此通过使用TApplicationEvents组件并在WebBrowser句柄上的OnMessage事件中检查右键单击事件,或者它的任何子句柄(use)和set Handled,您应该能够阻止它 代码可能是这样的 procedure TMyForm.ApplicationEvents1Message(var Msg: tagMSG;
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;
过程TForm1.FormMouseActivate(发送方:TObject;按钮:TMouseButton;
Shift:tshift-state;X,Y,HitTest:Integer;
var MouseActivate:TMouseActivate);
开始
如果按钮=mbRight,则
开始
如果(x>=WebBrowser1.左)和
(x=WebBrowser1.顶部)和
谢谢你的回答,你能给我举个例子吗?