Search Tools Links Login

A Complete & Easy SysTray Dll

This dll and test project allow you to easily place an icon in the system tray and set its tooltip. This dll provides MouseMove, MouseDown, MouseUp, Click, DoubleClick, Minimize, and Restore events, and allows you to easily minimize a form to the tray. You can also specify a popup menu, and how it responds. (eg: on right click,double click etc...)
I've added a new property (Persistent) which reloads the icon if Explorer crashes. Please let me know if you find any bugs with it.

Original Author: Alan Toews


icon, tooltip, form and several response style settings.


events are raised on all mouse activity, and the mouse button used is returned in the event

Side Effects

Will cause an error on shutdown if Class_Terminate code is not allowed to run (IE: using End to stop your program)

API Declarations

'API declarations for setting the tray icon
Private Declare Function SetForegroundWindow _
Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Shell_NotifyIcon _
Lib "shell32" Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
'API declarations for capturing mouse events in
'the tray icon
Private Declare Function CallWindowProc _
Lib "user32" Alias "CallWindowProcA" (ByVal _
lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal _
Msg As Long, ByVal wParam As Long, ByVal lParam _
As Long) As Long
Private Declare Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" (ByVal hwnd _
As Long, ByVal nIndex As Long, ByVal dwNewLong _
As Long) As Long

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 78 times


Visual Basic 6

Posted: 9/3/2020 3:45:00 PM
Size: 13,246 bytes

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.