Rx Tray Icon

RX Library

Control Name Unit Class
Tray Icon RxShell TRxTrayIcon

Description:
The TRxTrayIcon component enables 32-bit Delphi applications to add icons to the Windows 95 or Windows NT 4.x tray. The icon can be added to the tray by setting the Active property to true, and can be removed from the tray by setting the Active property to false.

The Icon property specifies static icon to the tray. If you want animate icons in the tray, set values to the Icons property and set the Animated property to True. You can test tray-icon in design-time by setting the ShowDesign property to True. To respond to mouse events for the icon, use the OnClick and OnDblClick events.

Note:
To display a pop-up menu when the user clicks the right mouse button on the Tray Icon, assign a PopupMenu component to the PopupMenu property and set the AutoPopup property of the menu to True.

To display a Help Hint whenever the mouse pointer pauses over the icon momentarily, set the Hint property to a help string.
You can use 16x16 icons with the TRxTrayIcon component as well as 32x32 icons.


Property Active
Declaration: Active: Boolean;

Set the Active property to True to add an Icon to the Windows 95 Tray.
Set the Active property to False to remove the Icon from the Windows 95 Tray.

If the
Animated property is True, the Icons property used to show animation in the Tray,
if the
Animated property is False, then icon specified by the Icon property used to show static icon in the Windows 95 Tray.


Property Animated
Declaration: Animated: Boolean;

The Animated property is used to show animated icons in Windows 95 Tray. The icons to be used in the animation are listed in the Icons property, and the time to wait between animation frames is specified by the Interval property.


Property Icons
Declaration: Icons: TIconList;

The Icons property is used to define the animation that will occur when a Tray Icon has Active property set to True and Animated property set to True also (if Animated property is False, the static Icon property use instead). The time to wait between animation frames is specified by the Interval property. The property editor of the Icons property allows you to load Windows animation cursors (ani-files) to this property.


Property ShowDesign
Declaration: ShowDesign: Boolean;

This property allows you to testing tray icon in design-time.
(This property is Ignored during run-time.)


Event OnClick
Declaration: OnClick: TMouseEvent;

To respond to mouse click events (left or right button) for the icon in Windows System Tray, use an OnClick event.


Type TExecState
Declaration: TExecState = (esNormal, esMinimized, esMaximized, esHidden);

TExecState type defines the four possible initial states of the launched applications main window for the InitialState parameter of FileExecute and FileExecuteWait functions: normal, minimized, maximized or hidden.


Routine FileExecute
Declaration: function FileExecute(const FileName, Params, StartDir: string; InitialState: TExecState): THandle;

The FileExecute function opens a specified file. The file can be an executable file or a document file. If FileName specifies an executable file, Params is a string that specifies parameters to be passed to the application. StartDir specifies the default directory. If FileName specifies an executable file, InitialState specifies how the application is to be shown

when it is opened. This parameter can be one of the following values: esNormal, esMinimized, esMaximized or esHide. If the function succeeds, the return value is the instance handle of the application that was run. If the function fails, the return value is an error value that is less than or equal to 32.

FileExecute example:
if FileExecute('NOTEPAD.EXE', '', 'C:\', esNormal) <= 32 then
ShowMessage('Can't start NOTEPAD.EXE');


Routine FileExecuteWait
Declaration: function FileExecuteWait(const FileName, Params, StartDir: string; InitialState: TExecState): Integer;

This function is similar to the FileExecute function, but it don't return until after a launched program finishes executing.

32-bit version: If the function succeeds, the return value is termination status of the executed process. If the function fails, the return value is -1.

16-bit version: If the function succeeds, the return value is zero. If the function fails, the return value is -1.

> FileExecuteWait example:

if not FileExecuteWait('NOTEPAD.EXE', 'readme.txt', 'C:\', esNormal) then
ShowMessage('Can not start NOTEPAD.EXE');


Routine IconExtract
Declaration: function IconExtract(const FileName: string; Id: Integer): TIcon;

The IconExtract function creates the TIcon object from the given executable file, dynamic-link library (DLL), or icon file. The FileName parameter specifies the name of an executable file, DLL, or icon file. The ID parameter specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If the function succeeds, the return value is the pointer to the Icon-object. After using the icon you must destroy it by Free method.

IconExtract example:

var
__Ico: TIcon;
begin
__Ico := IconExtract('PROGMAN.EXE', 0);
__try
____{ use icon }
__finally
____Ico.Free;
__end;
end;


Routine WinAbout
Declaration: procedure WinAbout(const AppName, Stuff: string);

The WinAbout procedure displays a Shell About dialog box.

Please note that the WinAbout procedure dialog box uses text and a default icon that are specific to either Microsoft Windows or Microsoft Windows NT. An example of a Shell About dialog box can be seen by selecting the About Program Manager command in Program Manager.

The AppName parameter is the text that the procedure displays in the title bar of the About dialog box and on the first line of the dialog box after the text "Microsoft Windows" or "Microsoft Windows NT". If the text contains a "#" separator, dividing it into two parts, the function displays the first part in the title bar, and the second part on the first line after the text "Microsoft Windows" or

"Microsoft Windows NT".

The Stuff parameter is the text that the function displays in the dialog box after the version and copyright information.

> WinAbout example:
WinAbout('Delphi Demo Application', 'Borland Int., 1995');


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000