Class TTrayIcon (unit TJayIcon) |
Inherits from
TComponent
constructor Create(AOwner: TComponent);
- --------------------- TTrayIcon ----------------------
destructor Destroy;
tnid.
procedure HideMainForm;
The main form has now been shown
procedure ShowMainForm;
Change icon or tooltip if icon already placed
procedure Click;
procedure DblClick;
Call the method that user has assigned to the event (if any
function HideIcon: Boolean;
Add/show the icon on the tray
procedure Loaded;
Free the handle of tray window
function ModifyIcon: Boolean;
Remove/hide the icon from the tray
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
procedure MouseMove(Shift: TShiftState; X, Y: Integer);
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
function ShowIcon: Boolean;
procedure HandleMessage(var Msg: TMessage);
Message handler for the shell notification window (tray icon).
function InitIcon: Boolean;
Msg.
procedure PopupAtCursor;
Hide the form itself
procedure SetHint(Value: String);
Not really necessary
procedure SetIcon(Value: TIcon);
StrLCopy must be used since szTip is only 64 bytes (dumb
procedure SetIconVisible(Value: Boolean);
procedure SetShowHint(Value: Boolean);
property Hint : String
Properties:
property Icon : TIcon
property IconVisible : Boolean
property LeftPopup : Boolean
property PopupMenu : TPopupMenu
property ShowHint : Boolean
property StartMinimized : Boolean
event OnClick : TNotifyEvent
Main form minimized on appl.
event OnDblClick : TNotifyEvent
event OnMouseDown : TMouseEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp : TMouseEvent
FClicked : Boolean;
FHint : String;
FIcon : TIcon;
FEnabled: Boolean;
FIconVisible : Boolean;
FLeftPopup : Boolean;
FOnClick : TNotifyEvent;
FOnDblClick : TNotifyEvent;
FOnMouseDown : TMouseEvent;
FOnMouseMove : TMouseMoveEvent;
FOnMouseUp : TMouseEvent;
FPopupMenu : TPopupMenu;
FShowHint : Boolean;
FStartMinimized : Boolean;
ShowFirst : Boolean;
tnid : TNotifyIconData;
constructor Create(AOwner: TComponent);
--------------------- TTrayIcon ----------------------
destructor Destroy;
tnid.hIcon := FIcon.Handle;
procedure HideMainForm;
The main form has now been shown
procedure ShowMainForm;
Change icon or tooltip if icon already placed
procedure Click;
procedure DblClick;
Call the method that user has assigned to the event (if any
function HideIcon: Boolean;
Add/show the icon on the tray
procedure Loaded;
Free the handle of tray window
function ModifyIcon: Boolean;
Remove/hide the icon from the tray
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
procedure MouseMove(Shift: TShiftState; X, Y: Integer);
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
function ShowIcon: Boolean;
procedure HandleMessage(var Msg: TMessage);
Message handler for the shell notification window (tray icon).
Most messages are passed through WM_TRAYNOTIFY. Use lParam to
get the actual message, eg. WM_MOUSEMOVE.
Send the usual Delphi events for the mouse messages. Also
interpolate the OnClick event when the user clicks the left
button, and popup the menu, if there is one, for left and right
mouse down events.
function InitIcon: Boolean;
Msg.Result := DefWindowProc(tnid.Wnd, Msg.Msg, Msg.wParam, Msg.lParam);
procedure PopupAtCursor;
Hide the form itself
procedure SetHint(Value: String);
Not really necessary
procedure SetIcon(Value: TIcon);
StrLCopy must be used since szTip is only 64 bytes (dumb
procedure SetIconVisible(Value: Boolean);
procedure SetShowHint(Value: Boolean);
property Hint : String
Properties:
property Icon : TIcon
property IconVisible : Boolean
property LeftPopup : Boolean
property PopupMenu : TPopupMenu
property ShowHint : Boolean
property StartMinimized : Boolean
event OnClick : TNotifyEvent
Main form minimized on appl. start-up? Events:
event OnDblClick : TNotifyEvent
event OnMouseDown : TMouseEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp : TMouseEvent
FClicked : Boolean;
FHint : String;
FIcon : TIcon;
FEnabled: Boolean;
FIconVisible : Boolean;
FLeftPopup : Boolean;
FOnClick : TNotifyEvent;
FOnDblClick : TNotifyEvent;
FOnMouseDown : TMouseEvent;
FOnMouseMove : TMouseMoveEvent;
FOnMouseUp : TMouseEvent;
FPopupMenu : TPopupMenu;
FShowHint : Boolean;
FStartMinimized : Boolean;
ShowFirst : Boolean;
tnid : TNotifyIconData;