干嘛要用控件,用API只有几条语句,何乐而不为?
比如添加:
with aIconData do begin
uFlags:=NIF_MESSAGE or NIF_ICON or NIF_TIP;
uID:=UINT(IDI_TRAYICON);
cbSize:=sizeof(TNotifyIconData);
Wnd:=self.Handle;
uCallbackMessage:=Tray_CallBack;
hIcon:=aIcon;
StrPCopy(szTip,ShowTip);
end; // end of with
Shell_NotifyIcon(NIM_ADD,@aIconData);
删除:
with aIconData do begin
uFlags:=0;
uID:=UINT(Idi_TrayIcon);
cbSize:=sizeof(TNotifyIconData);
Wnd:=self.Handle;
uCallbackMessage:=TRAY_CALLBACK;
hIcon:=0;
szTip:='';
end; // end of with
Shell_NotifyIcon(NIM_DELETE,@aIconData);