【例子介绍】Delphi 托盘实例
begin
inherited;
if Msg.LParam = WM_LBUTTONDBLCLK then
begin //双击图片图标还原窗体
ShowWindow(Application.Handle, SW_SHOW);
ShowWindow(Application.Handle, SW_SHOWNORMAL);
Application.BringToFront;
Shell_NotifyIcon(NIM_Delete, @MINIFTPFF);
end
else if Msg.LParam = WM_RBUTTONUP then
begin
SetForegroundWindow(Handle);
GetCursorPos(mouse);//获得鼠标坐标
PopupMenu1.Popup(mouse.X, mouse.Y);//在鼠标光标处显示弹出菜单
end;
// if (Msg.Msg = WM_NCACTIVATE) then
// PopupForm.Destroy;
// 响应任务栏托盘重建消息
if Msg.Msg = MsgTaskbarRestart then
MiniToTaskbar; // 最小化到托盘
评论