Both IconTray251.dll and the example program were written by me, Scott Adkins (sadkins@freenet.columbus.oh.us). I apologize if this document does not explain everything you need to know about IconTray.
Unfortunately, because of the time and effort I have had to put into this program, I have had to raise the registering cost to $20 (Sorry, the source code is no longer available). I do hope I don't have to go over these amounts. If you wish to register please send a check (no cash or credit cards, please) made out to Scott Adkins to the address below. Please include your email address, so I can send you future updated versions.
I suggest you go completely through the included source code (which is documented) and get aqainted with it first, this way you'll understand the methods and properties better. Below is a listing of the methods and properties used in IconTray and their syntax.
Methods
Add 'This will add the specified icon to the Icon Tray
Remove 'This will delete the icon in the icon tray
Update 'Use this to update the icon, after changing its properties
Status 'This tell you which mouse button was clicked (See below for 'property values), best used in a Timer control with an interval of 1. See 'the included source code for an example.
'Values = RightClickEvent, LeftClickEvent, RightDoubleClickEvent, 'LeftDoubleClickEvent, and MouseMoveEvent
StatusOut 'This MUIconTray be used AFTER entering the source code for mouse 'clicks. See included source code Timer1.Timer.
Properties
ToolTip = "Enter the text you want to be the icons ToolTip here" 'Pretty self-explainatory, don't you think?
Icon = PictureSource 'Example IconTray.Icon = Image1.Picture. You cannot enter a filename here! You must have an object holding the icon.
Before you can use IconTray, you need to register it with your computer. To do this, use the included file "Regsvr32.exe". Type at your command prompt "regsvr32 c:\windows\system\IconTray2.dll" and hit enter.
To use IconTray v2.0 in a VB4 project, you must first move file "IconTray2.dll" to your Windows\System directory, then open Visual Basic 4.0, select the "Tools" menu, select the "References" submenu, and select the box "IconTray v2.0" (if it does not appear among the selections, use browse to select it). Then, enter this code in your "General" and "Declarations" section of your form:
Option Explicit
Public IconTray As New Icon 'You can replace the IconTray variable with any 'other variable you wish
To detect mouse events, create a timer control and put this code in Timer1.Timer
Private Sub Timer1_Timer()
'set the most recent event
If IconTray.Status <> "Nothing" Then
If IconTray.Status = "LeftClickEvent" Then lblRecent.Caption = "Left Click"
If IconTray.Status = "LeftDoubleClickEvent" Then lblRecent.Caption = "Double-Left Click"
If IconTray.Status = "RightClickEvent" Then lblRecent.Caption = "Right Click"
If IconTray.Status = "RightDoubleClickEvent" Then lblRecent.Caption = "Double-Right Click"
If IconTray.Status = "MouseMoveEvent" Then lblRecent.Caption = "Mouse Moved Over"
End If
' The below If/Then/Else statement controls code if the mouse moves over 'icon
If IconTray.Status = "MouseMoveEvent" Then
IconTray.StatusOut
End If
' The below If/Then/Else statement controls code for Right Clicking On 'the Icon
If IconTray.Status = "RightClickEvent" Then
IconTray.StatusOut 'NEVER delete this line! It is essential to 'the any program using IconTray.dll
End If
' The below If/Then/Else statement controls code for Left Clicking On the 'Icon
If IconTray.Status = "LeftClickEvent" Then
IconTray.StatusOut 'NEVER delete this line! It is essential to 'the any program using IconTray.dll
End If
' The below If/Then/Else statement controls code for Left-Double Clicking 'On the Icon
If IconTray.Status = "LeftDoubleClickEvent" Then
IconTray.StatusOut 'NEVER delete this line! It is essential to 'the any program using IconTray.dll
End If
' The below If/Then/Else statement controls code for Right-Double 'Clicking On the Icon
If IconTray.Status = "RightDoubleClickEvent" Then
IconTray.StatusOut 'NEVER delete this line! It is essential to 'the any program using IconTray.dll
End If
End Sub
I think the above code is pretty self-explanatory too.
And of course, you will also need to put some kind of control to put the icon up there, delete it, modify it, etc.