To zengguocai:<br>不好意思,忘了把用法告诉你了...<br>WM_ICONTRAY 是个自定义消息:<br>uses ShellAPI;<br>WM_ICONTRAY = WM_USER + 1;<br>另外在 Form 初始化的时候需要做一些工作,将托盘结构与 Form 关联:<br>private<br> ...<br> FNotifyIconData: TNotifyIconData;<br> ...<br>procedure TMainForm.FormCreate(...);<br>begin<br> ...<br> with FNotifyIconData do<br> begin<br> cbSize := SizeOf(TNotifyIconData);<br> Wnd := Self.Handle;<br> uID := 1;<br> uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;<br> uCallbackMessage := WM_ICONTRAY;<br> hIcon := Application.Icon.Handle; <br> StrCopy(@szTip, '来自托盘的提示');<br> end;<br> Shell_NotifyIcon(NIM_ADD, @FNotifyIconData);<br> ...<br>end;<br><br>procedure TMainForm.FormDestroy(...)<br>begin<br> Shell_NotifyIcon(NIM_DELETE, @FNotifyIconData);<br>end;