medipalyer的右键菜单如何隐藏????(50分)

  • 主题发起人 cyberay520
  • 开始时间
C

cyberay520

Unregistered / Unconfirmed
GUEST, unregistred user!
mediaplayer 中
PARAM中哪个属性是可以隐藏右键菜单的???
 
让PopupMenu属性为空。
 
参考以下,可能有简单办法,好象是 disable...menu 方法,看看控件有没有类似的方法。
2. 处理RealPlayer控件的上下文菜单
其实RealPlayer 的“上下文菜单”不是真正意义上的上下文菜单,是一个右键点下菜单。仔细观察,会发现不同于其它控件的上下文菜单。
要想自定义该“上下文菜单”,对PupupMenu赋值,并在Application.OnMessage中进行处理:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, RealAudioObjects_TLB, StdCtrls, Menus;
type
TForm1 = class(TForm)
RealAudio1: TRealAudio;
PopupMenu1: TPopupMenu;
aaaa1: TMenuItem;
aaaa2: TMenuItem;
procedure myproc(var Msg:TMsg;var Handled:boolean);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.myproc(var Msg: TMsg;
var Handled: boolean);
var
x1,y1,x2,y2,x,y:integer;
b:Boolean;
p:TPoint;
begin
x1:=realAudio1.left;
y1:=realAudio1.top;
x2:=x1+realAudio1.Width;
y2:=y1+realAudio1.height;
p:=ScreenToClient(msg.pt);
x:=p.x;
y:=p.y;
b:=((x>=x1) and (x<=x2) and (y>=y1) and (y<=y2));
if (b) then
begin
if (msg.message=wm_Rbuttondown) then
handled:=true;
if (msg.message=wm_Rbuttonup) then
begin
if assigned(realAudio1.PopupMenu) then
TrackPopupMenu(realAudio1.PopupMenu.Handle,
TPM_LEFTALIGN,msg.pt.x,msg.pt.y,0,handle,nil);
handled:=true;
end;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage :=myproc;
end;

end.
 
参考
http://www.java-cn.com/
 
参考
http://www.java-cn.com/
 
顶部