你试过了吗,我试了不行!
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;