如下编程:
var
Form1: TForm1;
nd:notifyicondata;
hs:longword;
formhide:boolean;
information:string;
c_already_run_time:string;
c_current_time:string;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin // form1.Icon.Handle;
formhide:=true;
hs:=loadicon(hinstance,'mainicon');
//填充NotifyIconData记录型变量nd1
nd.cbSize := sizeof(NotifyIconData);
nd.Wnd := handle;
nd.uID := 0;
nd.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
nd.uCallbackMessage := WM_TRAYNOTIFY;
nd.hIcon := hs;
StrPLCopy(nd.szTip, '成功!', 63);
//在任务栏状态区添加图标
Shell_NotifyIcon(NIM_ADD, @nd);
timer1.enabled:=true;
end;