| Class TTrayIcon (unit TJayIcon) |
TComponent
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
destructor Destroy;
procedure HideMainForm;
procedure ShowMainForm;
procedure Click;
procedure DblClick;
function HideIcon: Boolean;
procedure Loaded;
function ModifyIcon: Boolean;
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);
function InitIcon: Boolean;
procedure PopupAtCursor;
procedure SetHint(Value: String);
procedure SetIcon(Value: TIcon);
procedure SetIconVisible(Value: Boolean);
procedure SetShowHint(Value: Boolean);| Properties |
property Hint : String
property Icon : TIcon
property IconVisible : Boolean
property LeftPopup : Boolean
property PopupMenu : TPopupMenu
property ShowHint : Boolean
property StartMinimized : Boolean| Events |
event OnClick : TNotifyEvent
event OnDblClick : TNotifyEvent
event OnMouseDown : TMouseEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp : TMouseEvent| Variables |
FClicked : Boolean;
FHint : String;
FIcon : TIcon;
FIconVisible : Boolean;
FLeftPopup : Boolean;
FOnClick : TNotifyEvent;
FOnDblClick : TNotifyEvent;
FOnMouseDown : TMouseEvent;
FOnMouseMove : TMouseMoveEvent;
FOnMouseUp : TMouseEvent;
FPopupMenu : TPopupMenu;
FShowHint : Boolean;
FStartMinimized : Boolean;
ShowFirst : Boolean;
tnid : TNotifyIconData;| Constructors |
constructor Create(AOwner: TComponent);--------------------- TTrayIcon ----------------------
| Functions |
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);| Properties |
property Hint : StringProperties:
property Icon : TIcon
property IconVisible : Boolean
property LeftPopup : Boolean
property PopupMenu : TPopupMenu
property ShowHint : Boolean
property StartMinimized : Boolean| Events |
event OnClick : TNotifyEventMain form minimized on appl. start-up? Events:
event OnDblClick : TNotifyEvent
event OnMouseDown : TMouseEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp : TMouseEvent| Variables |
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;