System TrayIcon Code Example PB 10.0.2
-----------------------------------------------------------
This code demonstrates how to add a system tray icon in your application
It uses 5 Global External Functions...

Public Function Integer Shell_NotifyIcon (Long dwMessage, Any lpData) Library "shell32" Alias For "Shell_NotifyIconA"
Public Function Long LoadImage (Long hInst, String lpsz, Long un1, Long n1, Long n2, Long un2) Library "user32" Alias  For LoadImageA;Ansi" 
Public Function Long DestroyIcon (Long hIcon) Library "user32" Alias For "DestroyIcon"
Public Function Long SetForegroundWindow  (Long hwnd) Library "user32" Alias For "SetForegroundWindow"
Public Function Long OpenIcon  (Long hwnd) Library "user32" Alias For "OpenIcon"

1-It has two important functions AddtoTray() and RemovefromTray()
2-Opening window visibility is set to false if it is successfully added to system tray
3-Mousemove event of window controls the user interaction with system tray icon

Author
---------
Muhammad Atif
atifajmal@hotmail.com