delphi隐藏窗体在windows任务栏,在右下角,单独集成单元文件,比控件好用,支持delphi7---XE10,主要区分是下面的函数 delphiXE10 procedure TShellNotifyIcon.LoadAppIcon; var s: string; begin with NotifyIcon do begin cbSize := SizeOf; //TNotifyIconData Wnd := Classes.AllocateHWnd(WndProc); uID := 1; uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP; uCallBackMessage := WM_NotifyIcon; hIcon := Application.Icon.Handle; s := HintStr; //StrLCopy(szTip, PAnsiChar(s), Length(s)); //Icon.OnClick:=onclik(TObject); StrCopy(szTip,PChar(s)); e nd; Shell_NotifyIcon(NIM_ADD, @NotifyIcon); end; delphi7 procedure TShellNotifyIcon.LoadAppIcon; var s: string; begin with NotifyIcon do begin cbSize := SizeOf(TNotifyIconData); //TNotifyIconData Wnd := Classes.AllocateHWnd(WndProc); uID := 1; uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP; uCallBackMessage := WM_NotifyIcon; hIcon := Application.Icon.Handle; s := HintStr; //StrLCopy(szTip, PAnsiChar(s), Length(s)); //Icon.OnClick:=onclik(TObject); StrCopy(szTip,PChar(s)); end; Shell_NotifyIcon(NIM_ADD, @NotifyIcon); end; nd; Shell_NotifyIcon(NIM_ADD, @NotifyIcon); end; delphi7 procedure TShellNotifyIcon.LoadAppIcon; var s: string; begin with NotifyIcon do begin cbSize := SizeOf(TNotifyIconData); //TNotifyIconData Wnd := Classes.AllocateHWnd(WndProc); uID := 1; uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP; uCallBackMessage := WM_NotifyIcon; hIcon := Application.Icon.Handle; s := HintStr; //StrLCopy(szTip, PAnsiChar(s), Length(s)); //Icon.OnClick:=onclik(TObject); StrCopy(szTip,PChar(s)); end; Shell_NotifyIcon(NIM_ADD, @NotifyIcon); end;