procedure TForm3.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message = WM_RBUTTONDOWN then //如果是右键,就屏蔽它,弹出自己的菜单
begin
PopupMenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
Handled := True;
if Msg.message = WM_LBUTTONDOWN then //如果是左键???? 这里不行
self.perform(WM_SYSCOMMAND,$F012,0);
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message = WM_RBUTTONDOWN then
//如果是右键,就屏蔽它,弹出自己的菜单
begin
PopupMenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
Handled := True;
end; ///////////少了这个
if Msg.message = WM_LBUTTONDOWN then
//如果是左键???? 这里不行
self.perform(WM_SYSCOMMAND,$F012,0);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage:=ApplicationEvents1Message;
end;
procedure TForm1.myMessage(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message = WM_LBUTTONDOWN then
self.perform(WM_SYSCOMMAND,$F012,0);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage:=myMessage;
end;