换掉RealPlay的右键菜单?(50分)

  • 主题发起人 主题发起人 ymqpc
  • 开始时间 开始时间
Y

ymqpc

Unregistered / Unconfirmed
GUEST, unregistred user!
换掉RealPlay的右键菜单?
用Delphi6+Win2000+Realplay8.0用Realplay的ActiveX写一个小软件,但不能把RealPlay的原来的英文菜单换掉!
 
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin

if (Msg.message = WM_RBUTTONDOWN) and (msg.hwnd =RealAudio1.handle) then

begin

popupmenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
// popupmenu1 是你自己的那个,
Handled := True;
end;

end;


RealAudio1.PopUpMenu:=popupmenu1;
 
你试过了吗,我试了不行!
unit Unit1;

interface

uses
Windows,forms, Dialogs, ExtCtrls, Menus, StdCtrls, ComCtrls, Controls, jpeg,
MPlayer, Classes,messages,sysutils,mmsystem,untDrag, OleCtrls,
ShockwaveFlashObjects_TLB, RealAudioObjects_TLB,Registry;
type
TPlayerForm = class(TForm)
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
Real: TRealAudio;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyMessage(var msg:tmsg;var handled:boolean);
public
{ Public declarations }
end;


var
PlayerForm: TPlayerForm;

Implementation

{$R *.dfm}

procedure TPlayerForm.FormCreate(Sender: TObject);
begin

Application.OnMessage:=MyMessage;
end;

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

if (msg.message=WM_RBUTTONDOWN) and (msg.hwnd=Real.Handle) then

begin

PopupMenu1.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);
Handled:=True;
end;

end;

 
这样修改一下
procedure TForm1.mymessage(var msg: tmsg;
var handled: boolean);
begin

if (msg.message=WM_RBUTTONDOWN) and [blue]IsChild(Real.Handle,msg.hwnd)[/blue] then

begin

PopupMenu1.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);
Handled:=True;
end;

end;

 
我把
procedure mymessage(var msg:tmsg;var handled:boolean);
换为你的var Msg: tagMSG;
var Handled: Boolean);
换后为: procedure mymessage(var msg:tagmsg;var handled:boolean);
能正常运行.我找到了这个东西:
{ Message structure }
PMsg = ^TMsg;
tagMSG = packed record
hwnd: HWND;
message: UINT;
wParam: WPARAM;
lParam: LPARAM;
time: DWORD;
pt: TPoint;
end;

用var msg:TMsg和var msg:TagMsg有什么区别吗?

要你有能换掉菜单的代码能发一份过来吗?
E-Mail:ymqpc@163.com
谢了!
 
可以直接修改注册表实现
 
已是OK了.
谢了.
能不能让我知道为什么要把msg.hwnd=Real.Handle换成这样IsChild(Real.Handle,msg.hwnd)才行?

对了这里有一个东西能让没有装过RealPlayer或RealOne的计算机能播放Rm,Rmvb,Ra,Ram格式的东西!
http://www.intersurfradio.de/download/realalt104.exe
好像就是只安装所有的插件吧,不会安装RealPlay播放器.
还有Realalt101.exe,Realalt102.exe,Realalt103.exe的旧板本!
 
多人接受答案了。
 
后退
顶部