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.