L
lcl_003
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是关于修改托盘图标的一段代码,不明白啥意思,帮忙给加上注释吧
procedure TForm1.ModifyTrayIcon(Action: DWORD);
var
NIData: TNotifyIconData;
begin
with NIData do
begin
cbSize := sizeof(TNotifyIconData);
UID := 0;
uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP
//尤其是这里
Wnd := Handle;
uCallBackMessage := WM_TRAYICON;
HICON := Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(Action, @NIData);
end;
procedure TForm1.WMTrayIcon(var message: TMessage);
var
MousePos: TPoint;
begin
if message.LPARAM = WM_RBUTTONDOWN then
begin
SetActiveWindow(Handle);
GetCursorPos(MousePos);
PopupMenu.Popup(MousePos.X, MousePos.Y);
end;
end;
procedure TForm1.ModifyTrayIcon(Action: DWORD);
var
NIData: TNotifyIconData;
begin
with NIData do
begin
cbSize := sizeof(TNotifyIconData);
UID := 0;
uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP
//尤其是这里
Wnd := Handle;
uCallBackMessage := WM_TRAYICON;
HICON := Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(Action, @NIData);
end;
procedure TForm1.WMTrayIcon(var message: TMessage);
var
MousePos: TPoint;
begin
if message.LPARAM = WM_RBUTTONDOWN then
begin
SetActiveWindow(Handle);
GetCursorPos(MousePos);
PopupMenu.Popup(MousePos.X, MousePos.Y);
end;
end;