我有一个使用了
这里是我的菜单位置:
CoolTrayIcon
和PopupMenu
的项目,并且禁用了AutoPopup
属性。我想把弹出菜单定位并展示给用户。虽然位置正确,但是如果用户点击其他区域或按下ESC键,菜单不会关闭。我没有发现任何类似于Active
的属性可以判断菜单是否在使用中。这里是我的菜单位置:
procedure TForm1.CoolTrayIcon1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
pnt: TPoint; yy:integer;
begin
GetCursorPos(pnt);
yy:=pnt.y; yy:=yy-500;
if (Button=mbRight) then begin
PopupMenu1.Popup(pnt.X, yy);
end;
end;
如果需要关闭菜单,我应该如何管理呢?
WM_CONTEXTMENU
。系统会进行繁重的工作,并将适当的用户输入转换为该消息。由于通知图标的不同版本,细节有些模糊。而我不知道这个特定组件的作用。 - David Heffernan