trayicon TacTrayIcon component
Hierarchy Properties Methods Events See also
Return to Introduction  Previous page  Next page
The acTrayIcon is handy component for manipulating the system tray icons in the taskbar status area. Allow to use the animated icons and contains the number of great features such like additional caption button on form's title bar minimizetotray and menu item in the system menu. acTrayIcon is fully automated and can be easily customized with number of various properties. It contains many others properties which allow you to associate your forms with tray icons on taskbar status area without ANY line of additional code!  
A non intrusive way to display an explanatory message for a status bar icon is to implement a balloon tooltip with its stem pointing to the icon. The acTrayIcon supports the cartoon-style balloon tooltips which appears after minimizing of the form to the system tray. Check out Win2kInfoBalloon structure for more details. The Win2kInfoBalloon can be specified in any Windows version but works (can be appears) in Windows 2000 and later.  
new! The acTrayIcon automatically detects when Windows Explorer was crashed or restarted and automatically restores the icon in the tray.  

Key properties
Animateanimate the tray icon, if multiple icons specified in ImageList.  
Iconspecifies the Icon to display in system tray.  
ImageListspecifies the list of icon images, if you would like to make tray icon Animated.  
Optionsnumber of various options that set behavior of tray icon  
PopupMenuassigns any popup menus to the tray icon. (acTrayIcon can automatically handle clicks on "Minimize-To-Tray", "Restore-From-Tray" and "What's This?" menu items — see PopupMenuRestoreItem, PopupMenuTrayMinimizeItem and PopupMenuWhatsThisItem properties)  
Hintthe text string which appears when mouse moves over the tray icon.  
Visibleshows or hides the tray icon.  
Win2kInfoBalloonthe cartoon-style balloon window with some important information once the tray icon minimized to the system tray. This feature works on Windows 2000 and later.  

Cool features
acTrayIcon is successor of acCustomCaptionButton class. It have a built-in support of the corresponding caption button on the form's title bar and the menu item in the system menu, associated with this button.  
Once the tray icon minimized to the system tray, it can show the balloon-style information window with some important information. Check out Win2kInfoBalloon property.  
new! The acTrayIcon have built-in "What's This?" popup window. Just specify the WhatsThisHint property and point the menu item (in the PopupMenu) which will execute this window. When user clicks the menu item specified in PopupMenuWhatsThisItem, the tray icon will show the popup window which can describe the purpose of the application and its tray icon.  
tip The acTrayIcon automatically minimizes the application to the system tray on program startup, if the application was executed with "/minimized" command-line parameter.  

How to change the glyphs for "Minimize to tray" button ?
To change the glyph for the "Minimize to tray" button, you have to modify the ACCB_MINIMIZETOTRAY bitmap resources in the "CaptionButtons.res" file of the AppControls pack. You can change them using standard Image Editor program which supplies with every Delphi/BCB version.  
After modifying of these glyphs in the "CaptionButtons.res", they will always with you in any programs, so you will do not need to specify the glyphs every time when you drop component onto form.  

See also:
Other components which contains a built-in caption button: acAppAutoRun, acFormHelp, acFormTopmost, acFormRoller.