DELPHI5 how do tray Yeah!

Category: Delphi -> Windows SDK/API Author: gzyubin Date: 2005-02-11 15:21:22
 
gzyubin
2005-02-11 15:21:22
Please be patient and give operational methods or EMAIL to me [email protected] thank
zxc78912
2005-02-11 15:36:00
unit SysTray_San;

interface
uses
windows, messages, sysutils, classes, graphics,
controls, shellapi, extctrls, menus, forms;
const
NIF_INFO = $ 10;
; NIM_SETVERSION = $ 00000004;
NOTIFYICON_VERSION = 3;
NIM_SETFOCUS = $ 00000003;
NIIF_INFO = $ 00000001;
NIIF_WARNING = $ 00000002;
NIIF_ERROR = $ 00000003;

NIN_BALLOONSHOW = WM_USER + 2;
NIN_BALLOONHIDE = WM_USER + 3;
NIN_BALLOONTIMEOUT = WM_USER + 4;
NIN_BALLOONUSERCLICK = WM_USER + 5;
NIN_SELECT = WM_USER + 0;
NINF_KEY = $ 1;
NIN_KEYSELECT = NIN_SELECT or NINF_KEY;
/ / / / / / / / / / / / / / / / / / / / / / / /
TRAY_CALLBACK = WM_USER + 8250;
/ / / / / / / / / / / / / / / / / / / / / / / / /
POMM = 0;
POLBDOWN = 1;
POLBUP = 2;
POLBDBC = 3;
PORBDOWN = 4;
PORBUP = 5;
PORBDBC = 6;
/ / / / / / / / / / / / / / / / / / / / / / / / /
type

TpopupOptionsRange = POMM .. PORBDBC;
TPopupOptions = set of ; TPopupOptionsRange;

PNewNotifyIconData = ^ TNewNotifyIconData;

TDUMMYUNIONNAME = Record
; case Integer of
0: (uTimeout: UINT);
1: (uVersion: UINT);
end;

TNewNotifyIconData = Record
cbSize: DWORD;
Wnd: HWND;
uID: UINT;
uFlags: UINT;
uCallbackMessage: UINT;
hIcon: HICON;
szTip: array [0 .. 127] of Char; / / Version 5.0 is 128, formerly 64 a
dwState: DWORD; / / Version 5.0
dwStateMask: DWORD; / / Version 5.0
szInfo: array [0 .. 255] of Char; / / Version 5.0
DUMMYUNIONNAME: TDUMMYUNIONNAME;
szInfoTitle: array [0 .. 63] of Char; / / Version 5.0
dwInfoFlags: DWORD; / / Version 5.0
end;
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
TSysTray_San = class (TWinControl)
private
FormHandle: cardinal;
TrayHint: string;
/ / / / / / / / / / / /
; Timer: TTimer;
CurrentIconIndex: integer;

IconData: TNewNotifyIconData;
PopupMenu: TPopupMenu;
; Added: boolean;
IconHandle: HICON;
IconList: TImageList;
/ / / / / / / / / / / / /
BalloonTitle: string;
BalloonText: string;
/ / / / / / / / / / / /
procedure OnTimer (sender: tobject);
/ / / / / / / / / / / / / /
procedure SysTrayIconMsgHandler (var Msg : TMessage); message TRAY_CALLBACK;
public
PopUpOptions: TPopupOptions;

OnMouseMove: TNotifyEvent;

OnLeftMouseDown: TNotifyEvent;
OnLeftMouseUp: TNotifyEvent;
OnLeftMouseDbClick: TNotifyEvent;

OnRightMouseDown: TNotifyEvent ;
OnRightMouseUp: TNotifyEvent;
OnRightMouseDbClick: TNotifyEvent;

OnBalloonShow: TNotifyEvent;
OnBalloonHide : TNotifyEvent;
OnBalloonTimeOut: TNotifyEvent;
OnBalloonClick: TNotifyEvent;

/ / / / / / / / / / / / / / / / / / / /
HideOnMin: boolean;
/ / / / / / / / / / / / / / / / / / / /
constructor Create (AForm: TForm);
destructor Destroy; override;
/ / / / / / / / / / / / / / / / / / / /
function Showed: boolean;
procedure SetPopupMenu (APopupMenu: TPopUpMenu);
; function GetPopupMenu: TPopupMenu;
procedure SetAnimation (Value: boolean);
procedure SetInterval (Value: integer);
function ; GetInterval: integer;
procedure SetIconList (List: TImageList);

procedure ChangeIconByIndex (Index: integer);
; procedure ChangeIconHandle (AIconHandle: HIcon);
function GetIconHandle: HIcon;
procedure SetHint (AStr: string);
function ; GetHint: string;
/ / / / / / / / / / / / / / / / / / / / /
procedure AddSysTrayIcon (AIconHandle: HICON) ;
procedure DeleteSysTrayIcon;
function ShowBalloonTips (Text, Title: string; Time: cardinal = 3000): boolean;
/ / / / / / / / / / / / / / / / / / /
procedure ShowMainForm;
procedure HideMainForm;

end;
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
implementation

{TSysTray_San}

procedure TSysTray_San.AddSysTrayIcon (AIconHandle: HICON);
begin

iconhandle: = aiconhandle;
IconData.hIcon: = aiconhandle; / / here is a Icon, Handle

added: = Shell_NotifyIcon (NIM_ADD, @ IconData);

end;

constructor TSysTray_San.Create (Aform: Tform);
begin
inherited create (aform);
added: = false;
formhandle: = aform.Handle;
popupoptions: = [];
timer: = ttimer.create (self);
timer.OnTimer: = ontimer;
timer.Enabled: = false;
/ / / / / / / / / / / / / / / /
icondata.cbSize: = sizeof (icondata);
IconData.Wnd: = AllocateHWnd (SysTrayIconMsgHandler);
IconData.uCallbackMessage: = TRAY_CALLBACK;
IconData.uID: = 0;
IconData.uFlags: = NIF_ICON or NIF_MESSAGE or NIF_TIP ;
/ / / / / / / / / / / / / / /
hideonmin: = true;

end ;

procedure TSysTray_San.DeleteSysTrayIcon;
begin
DeallocateHWnd (IconData.Wnd);
added: = not Shell_NotifyIcon ( NIM_DELETE, @ IconData);

end;

destructor TSysTray_San.Destroy;
begin
timer.Free;
if added then
self.DeleteSysTrayIcon;
inherited;
end;

function TSysTray_San.GetIconHandle: HIcon;
begin
result: = iconhandle;
end;

function TSysTray_San.GetInterval: integer;
begin
result: = timer.Interval;
end;

procedure TSysTray_San.SetAnimation (Value: boolean) ;
begin
timer.Enabled: = value;

end;

procedure TSysTray_San.ChangeIconHandle (AIconHandle: HIcon );
begin
icondata.hIcon: = aiconhandle;

IconData.uFlags: = NIF_ICON or NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon (NIM_MODIFY, @ IconData);
end;

procedure TSysTray_San.SetIconList (List: TImageList);
begin
iconlist: = list;
end;

procedure TSysTray_San.SetInterval (Value: integer);
begin
timer.Interval: = value;
end;

procedure TSysTray_San.SetPopupMenu (APopupMenu: TPopUpMenu);
begin
popupmenu: = apopupmenu;
end;

function TSysTray_San.ShowBalloonTips (Text, Title: string; Time: cardinal = 3000): boolean;
begin

IconData.uFlags: = NIF_INFO;

strPLCopy (IconData.szInfo, text, sizeof (IconData . szInfo) - 1);

IconData.DUMMYUNIONNAME.uTimeout: = time;

strPLCopy (IconData.szInfoTitle, Title, sizeof (IconData.szInfoTitle) - 1);

IconData.dwInfoFlags: = ; NIIF_INFO; / / NIIF_ERROR; / / NIIF_WARNING;

result: = Shell_NotifyIcon (NIM_MODIFY, @ IconData);
/ / The following code is not actually used, can also be removed (at least for now think so)

/ / IconData.DUMMYUNIONNAME.uVersion ;: = NOTIFYICON_VERSION;

/ / result: = Shell_NotifyIcon (NIM_SETVERSION, @ IconData);
end;
fhn200
2005-02-11 15:49:02
no code it would be so long?

procedure TEShellShellIcon.AddIconToShell (AForm: TForm; Msg: TMessage; strTip: string);
var
lpData: PNotifyIconData;
begin
if Msg.WParam = SC_ICON then
begin
/ / If the user minimizes window will be hidden window and add an icon on the taskbar
lpData: = new (PNotifyIconDataA);
; lpData.cbSize: = SizeOf (NotifyIconDataA);
lpData.Wnd: = AForm.Handle;
lpData.hIcon: = AForm.Icon.Handle;
lpData.uCallbackMessage: = WM_BARICON;
lpData.uID: = 0;
strpcopy (lpData.szTip, strtip);
; lpData.uFlags: = NIF_ICON or NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon (NIM_ADD, lpData);
dispose (lpData);
AForm.Visible: = False;
end
else
begin
/ / If other SystemCommand news is calling the system default handler handle it.
DefWindowProc (AForm.Handle, Msg.Msg, Msg.WParam, Msg.LParam);
end;
end;

procedure TEShellShellIcon.DelIConFromShell (AForm: TForm; Msg: TMessage; strTip: string);
var
lpData: PNotifyIconData ;
begin
if (Msg.LParam = WM_LBUTTONDOWN) then
begin
/ / If the user clicks on the icon in the taskbar icon will be cleared and restored windows.
lpData: = new (PNotifyIconDataA);
lpData.cbSize: = SizeOf (NotifyIconDataA );
lpData.Wnd: = AForm.Handle;
lpData.hIcon: = AForm.Icon.Handle;
lpData.uCallbackMessage: = WM_BARICON;
lpData.uID: = 0;
strpcopy (lpData.szTip, strtip);
lpData.uFlags: = NIF_ICON or ; NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon (NIM_DELETE, lpData);
dispose (lpData);
AForm.Visible: = True;
end;
end;

this is added delete tray code. Look carefully Shell_NotifyIcon on it.
jnzhangyue
2005-02-11 15:57:45
find a control on it.
TrayIcon
yesli78
2005-02-11 16:12:48
Do you mean to find the control, but also added to the system control, and then incorporated into my program go?
pzh121213
2005-02-11 16:26:37
function TSysTray_San.Showed: boolean;
begin
result: = added;
end;

procedure ; TSysTray_San.SysTrayIconMsgHandler (var Msg: TMessage);
var
p: tpoint;
begin
getcursorpos (p);
; case Msg.LParam of
WM_MOUSEMOVE:
begin
; if assigned (popupmenu) and (pomm in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onmousemove) then
self.OnMouseMove (self);
end;
WM_LBUTTONDOWN:
begin
if ; assigned (popupmenu) and (polbdown in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onleftmousedown) then
self.OnLeftMouseDown (self);
end;
WM_LBUTTONUP:
begin
if assigned (popupmenu ) and (polbup in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onleftmouseup) then
self.OnLeftMouseUp (self);
end;
WM_LBUTTONDBLCLK:
begin
if assigned (popupmenu) and ( polbdbc in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onleftmousedbclick) then
self.OnLeftMouseDbClick (self);
end;
WM_RBUTTONDOWN:
begin
if assigned (popupmenu) and ; (porbdown in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onrightmousedown) then
self.OnRightMouseDown (self);
end;
WM_RBUTTONUP:
begin
if assigned (popupmenu) and (porbup in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onrightmouseup) then
self.OnRightMouseUp (self);
end;
WM_RBUTTONDBLCLK:
begin
if assigned (popupmenu) and (porbdbc in popupoptions) then
popupmenu.Popup (pX, pY);
if assigned (onrightmousedbclick) then
self.OnRightMouseDbClick (self);
end;
/ / The following is the new message
NIN_BALLOONSHOW:
if assigned (onballoonshow) then {When Balloon ; Tips pops execution}
self.OnBalloonShow (self) ;/ / showmessage ('NIN_BALLOONSHOW');
; NIN_BALLOONHIDE:
if assigned (onballoonhide) then {disappears when the Balloon Tips execution (eg SysTrayIcon been removed), but the time specified by TimeOut mouse clicks Balloon Tips to or after the disappearance does not send this message}
self. OnBalloonHide (self) ;/ / showmessage ('NIN_BALLOONHIDE');
NIN_BALLOONTIMEOUT:
if assigned ( onballoontimeout) then {When Balloon Tips in TimeOut time when executed}
self.OnBalloonTimeOut (self) ;/ / showmessage ('NIN_BALLOONTIMEOUT');
NIN_BALLOONUSERCLICK:
if assigned (onballoonclick) then
self.onballoonclick (self); {when the mouse clicks Balloon Tips when executed.
Note: When running on XP Balloon Tips have a close button, and Balloon Tips
been Display (IconData.DUMMYUNIONNAME.uTimeout: = 3000;
this sentence set time no use, my test is so),
If you mouse over the button will receive NIN_BALLOONTIMEOUT messages. }
/ / Showmessage ('NIN_BALLOONUSERCLICK');
else
/ / beep; ;
end;
end;

procedure TSysTray_San.OnTimer (sender: tobject);
begin
if iconlist <> nil then
begin
if currenticonindex> iconlist.Count-1 then
currenticonindex: = 0;
changeiconbyindex (currenticonindex);
inc (currenticonindex);
end;
end;

function TSysTray_San.GetPopupMenu: TPopupMenu;
begin
result: = popupmenu;
end;

function TSysTray_San.GetHint: string;
begin
result: = trayhint;
end;

procedure TSysTray_San.SetHint (AStr: string);
begin
trayhint: = astr;
strPLCopy (IconData.sztip, astr, sizeof (IconData.szInfo) - 1);
IconData.uFlags: = NIF_ICON or NIF_MESSAGE or NIF_TIP;
Shell_NotifyIcon (NIM_MODIFY, @ IconData);
end;

procedure TSysTray_San.changeIconbyindex (Index: integer);
var
icn: ticon;
begin
if iconlist = nil then exit;
icn: = ticon.Create;
iconlist.GetIcon (index, icn);
changeiconhandle (icn.Handle);
icn.Free;

end;

procedure TSysTray_San.HideMainForm;
begin
showwindow (formhandle, sw_hide);
if hideonmin then
ShowWindow (Application.Handle, SW_HIDE);
end;

procedure TSysTray_San.ShowMainForm;
begin
showwindow (formhandle, sw_show);
end;

end.
wofe6661
2005-02-11 16:42:20
unit Unit1;

interface

uses
Windows, systray_san, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class (TForm)
procedure FormCreate (Sender: TObject);
procedure FormCloseQuery (Sender: TObject; var CanClose: Boolean);
private
sys: tsystray_san;
{Private declarations}
public
; {Public declarations}
end;

var
Form1: TForm1;

implementation

{$ R *. dfm}

procedure TForm1.FormCreate (Sender: TObject);
begin
sys: = tsystray_san.Create (self);
sys.AddSysTrayIcon (application.Icon.Handle);

end;

procedure TForm1.FormCloseQuery (Sender: TObject; var CanClose: Boolean);
begin
sys.Free;
end;

end.
Spark99
2005-02-11 17:01:13
Recommend to download it, it will save a lot of things.
xunyuan518
2005-02-11 17:10:11
with the above that much? Where the use of such a trouble ~!

understand notifyicondata data structure, and then change the data structure can ~!
remember to quote shellapi yo ~!

come right through shell_notifyicon Pallet Management
book_jilyforever
2005-02-11 17:28:30
shell_notifyicon
mengngbo
2005-02-11 17:47:02
not even realize the basic functions without writing class!
length is determined by function!

we look cooltrayicon bar code!

energy to achieve several systray balloon tips? ?
dqcsh
2005-02-11 18:01:30
less things right
Installing RX control is not on
xing010203
2005-02-11 18:11:39
or use cooltrayicon this control bar
fact delphi5 Programmer's Guide has
dreamindeath
2005-02-11 18:30:43
/ / forget it, ladies and Han also mention, to point to your real ---- stickers cooltrayicon code, the most cool the system tray delphi controls, more than I can write that "lengthy" and more! (Do not forget to check out quickly A: P):
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
{******************************* **********************************}
{This is a component for placing icons in the notification area}
{of the Windows taskbar (aka. the traybar). }
{}
{The component is freeware. Feel free to use and improve it.}
{I would be pleased to hear what you think. }
{}
{Troels Jakobsen - [email protected] ;}
{Copyright ( c) 2001 }
{************************************************ *****************}

unit CoolTrayIcon;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Menus, ShellApi, ExtCtrls;

const
{Define user-defined message sent by the trayicon. We avoid low user-defined
messages that are used by Windows itself (eg. WM_USER +1 = DM_SETDEFID).}
WM_TRAYNOTIFY ; = WM_USER + 1024;
/ / Constant used for recreating trayicon on system traybar recover
IconID = 1;
/ / Constants used for balloon hint feature
WM_RESETTOOLTIP = WM_USER + 1025;
NIIF_NONE = $ 00000000;
NIIF_INFO = $ 00000001;
NIIF_WARNING = $ 00000002;
NIIF_ERROR = $ 00000003;
NIF_INFO = $ 00000010;

var
WM_TASKBARCREATED: Cardinal;

type
{You can use the TNotifyIconData record structure defined in shellapi.pas.
However, WinME, Win2000, and WinXP have expanded this structure. We define
a similar structure, TNotifyIconDataEx.}
TNotifyIconDataEx = record
cbSize: DWORD;
Wnd: HWND;
uID: UINT;
uFlags: UINT;
uCallbackMessage: UINT;
hIcon: HICON;
/ / szTip: array [0 .. 63] of AnsiChar;
szTip: array [0 .. 127] of AnsiChar; / / 0 .. 63 of WideChar in stead?
; dwState: DWORD;
dwStateMask: DWORD;
szInfo: array [0 .. 255] of AnsiChar;
uTimeout: UINT; / / union with uVersion: UINT;
szInfoTitle: array [0 .. 63] of AnsiChar;
dwInfoFlags: DWORD;
end;

TBalloonHintIcon = (bitNone, bitInfo, bitWarning, bitError);
TBalloonHintTimeOut = 10 .. 60; / / Windows defines 10-60 secs. as min-max

TCycleEvent = procedure (Sender: TObject; NextIndex: Integer) of object;

TCoolTrayIcon = class (TComponent)
private
FEnabled: Boolean;
FIcon: TIcon;
FIconVisible: Boolean;
FHint: String;
FShowHint: Boolean;
FPopupMenu: TPopupMenu;
FLeftPopup: Boolean;
FOnClick,
FOnDblClick: TNotifyEvent;
FOnCycle: TCycleEvent;
FOnMouseDown,
FOnMouseUp: TMouseEvent;
FOnMouseMove: TMouseMoveEvent;
FStartMinimized: Boolean;
FMinimizeToTray: Boolean;
FClickStart: Boolean;
CycleTimer: TTimer; / / For icon cycling
FIconIndex: Integer; ; / / Current index in imagelist
FDesignPreview: Boolean;
SettingPreview: Boolean; / / Internal status flag
SettingMDIForm: Boolean; / / ; Internal status flag
FIconList: TImageList;
FCycleIcons: Boolean;
FCycleInterval: Cardinal;
OldAppProc, NewAppProc: Pointer; / / Procedure variables
; OldWndProc, NewWndProc: Pointer; / / Procedure variables
FWindowHandle: HWND; / / Window handle (not general handle)
; procedure SetCycleIcons (Value: Boolean);
procedure SetDesignPreview (Value: Boolean);
; procedure SetCycleInterval (Value: Cardinal);
procedure TimerCycle (Sender: TObject);
procedure HandleIconMessage (var Msg: TMessage);
function InitIcon: Boolean;
procedure SetIcon (Value: TIcon);
procedure SetIconVisible (Value: Boolean);
procedure SetIconList (Value: TImageList);
procedure SetIconIndex (Value: Integer);
procedure SetHint (Value: String);
; procedure SetShowHint (Value: Boolean);
procedure PopupAtCursor;
procedure HookApp;
procedure UnhookApp;
procedure HookAppProc (var Msg: TMessage);
; procedure HookParent;
procedure UnhookParent;
procedure HookWndProc (var Msg: TMessage);
protected
IconData: TNotifyIconDataEx; / / Data of the tray icon wnd.
procedure Loaded; override;
function ShowIcon: Boolean; virtual;
function HideIcon: Boolean; virtual;
function ModifyIcon: Boolean; virtual;
procedure Click; dynamic;
procedure DblClick; dynamic;
procedure CycleIcon; dynamic;
procedure MouseDown (Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); dynamic;
procedure MouseUp (Button: TMouseButton; Shift: TShiftState;
; X, Y: Integer); dynamic;
procedure MouseMove (Shift: TShiftState; X, Y: Integer); dynamic;
procedure DoMinimizeToTray; dynamic;
procedure Notification (AComponent: TComponent; ; Operation: TOperation);
override;
public
{$ IFDEF DFS_CPPB_3_UP}
; property Handle: HWND read IconData.hWnd;
{$ ELSE}
property Handle: HWND read ; IconData.Wnd;
{$ ENDIF}
property WindowHandle: HWND read FWindowHandle;
constructor ; Create (AOwner: TComponent); override;
destructor Destroy; override;
procedure ShowMainForm;
procedure HideMainForm;
function Refresh: Boolean;
function ShowBalloonHint (Title: String; Text: String; IconType: TBalloonHintIcon;
TimeoutSecs: TBalloonHintTimeOut): Boolean ;
function BitmapToIcon (const Bitmap: TBitmap; const Icon: TIcon;
; MaskColor: TColor): Boolean;
published
/ / Properties:
; property DesignPreview: Boolean read FDesignPreview
write SetDesignPreview default False;
property IconList: TImageList read FIconList write SetIconList;
property CycleIcons: Boolean read FCycleIcons write SetCycleIcons
; default False;
property CycleInterval: Cardinal read FCycleInterval
write SetCycleInterval;
property Enabled: Boolean read FEnabled write FEnabled default True;
property Hint: String read FHint write SetHint;
property ShowHint: Boolean read FShowHint write SetShowHint
; default True;
property Icon: TIcon read FIcon write SetIcon stored True;
; property IconVisible: Boolean read FIconVisible write SetIconVisible
default True;
property IconIndex: Integer read FIconIndex write SetIconIndex;
property PopupMenu: TPopupMenu read FPopupMenu write FPopupMenu;
property LeftPopup: Boolean read FLeftPopup write FLeftPopup
default False;
; property StartMinimized: Boolean read FStartMinimized write FStartMinimized
default False; / / Main form minimized on app. start-up?
property MinimizeToTray: Boolean read FMinimizeToTray write FMinimizeToTray
default False; / / Minimize main ; form to tray when minimizing?
/ / Events:
property OnClick: TNotifyEvent read ; FOnClick write FOnClick;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnMouseDown : TMouseEvent read FOnMouseDown write FOnMouseDown;
property OnMouseUp: TMouseEvent read FOnMouseUp write FOnMouseUp;
; property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove;
property OnCycle: TCycleEvent read FOnCycle write FOnCycle;
end;

procedure Register;

haofd
2005-02-11 18:50:23


implamentation too long, tell me what you email
to you!
tsjack
2005-02-11 19:02:53
Var IconData: TNotifyIconData;
Const
wm_MyCallback = wm_User +1000;
cm_Exit = 100;
cm_About = 101;
begin
; With IconData do Begin
cbSize: = SizeOf (IconData);
Wnd: = ; handle;
uID: = 1;
uFlags: = nif_Icon Or nif_Message Or nif_Tip ;
hicon: = extracticon (hInstance, 'd: \ ico \ 001.ico', 0);
lstrcpy (szTip 'Windows Superman');
uCallBackMessage: = wm_MyCallBack;
Shell_NotifyIcon (nim_Add, @ IconData); ;/ / join

Shell_NotifyIcon (nim_Delete, @ IconData) ;/ / delete
End;

end;