如何屏蔽real控件自带的右键弹出菜单?(用过real控件的高手请进!!!)(100分)

  • 主题发起人 主题发起人 jimmy81
  • 开始时间 开始时间
if (msg.message=wm_rbuttondown) and (msg.hwnd=flash.handle)

这一行有问题,仔细看清楚了,msg.hwnd=flash.handle 抄代码的时候要把它改成自己能用的!


你可以去掉这一句,或者改成你的real.handle
 
关于snowsky兄你说的这个问题我当然明了,我改成相对应的句柄了,可是还是不行啊!
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, RealAudioObjects_TLB, Menus;

type
TForm1 = class(TForm)
real: TRealAudio;
Button1: TButton;
opendialog1: TOpenDialog;
PopupMenu1: TPopupMenu;
n1: TMenuItem;
procedure mymessage(var msg:tmsg;var handled:boolean);
procedure Button1Click(Sender: TObject);
procedure n1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;


var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin


if opendialog1.Execute then


begin


real.Source:=opendialog1.FileName;

opendialog1.DoPlay;

end;


end;


procedure Tform1.mymessage(var msg: tmsg;
var handled: boolean);

begin


if (msg.message=wm_rbuttondown) and (msg.hwnd=real.PopupMenu.Handle) then


begin


handled:=true;

end;


end;



procedure TForm1.n1Click(Sender: TObject);

begin


showmessage('aaa');

end;



procedure TForm1.FormCreate(Sender: TObject);

begin


application.onmessage:=mymessage;

end;


end.

 
还望那位高手知道的能帮我解决下![:(]
 
难道在这个和平年代连高手都磨灭了?……

我可怜的问题,等到花2都谢了还没见到脚踩七色云彩的英雄来搭救我啊……我可怜的毕业

设计,估计是无法不带一点缺憾的交上去了……
 
关注...................
 
我知道,qiyuanwj@163.com
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
851
DelphiTeacher的专栏
D
后退
顶部