create中:
application.onmessage:=mymessage;
PUBLISH中:
procedure mymessage(var msg:tmsg;var handled:boolean);
实现:
procedure tform1.mymessage(var msg:tmsg;var handled:boolean);
begin
if (msg.message=wm_rbuttondown) and (msg.hwnd=flash.handle) then
begin
handled:=true;
end;
end;
这是让右键失效的程序,改一下,就能满足你的要求
将mymessage过程改成:
procedure TForm1.mymessage(var msg: tmsg; var handled: boolean);
begin
if (msg.message=wm_rbuttondown) and (msg.hwnd=ShockwaveFlash1.handle) then
begin
popupmenu1.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);
handled:=true;
end;
end;