Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我们';我们正在使用Flash!(德尔菲)_Flash_Delphi_Browser_Right Click - Fatal编程技术网

当我们';我们正在使用Flash!(德尔菲)

当我们';我们正在使用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;

当我使用WebBrowser浏览flash文件时,如何禁用flash player的菜单?

发送到WebBrowser的所有消息也会通过您的Delphi应用程序,因此通过使用TApplicationEvents组件并在WebBrowser句柄上的OnMessage事件中检查右键单击事件,或者它的任何子句柄(use)和set Handled,您应该能够阻止它

代码可能是这样的

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.顶部)和

谢谢你的回答,你能给我举个例子吗?