by chopin (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 6th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
adds a notify icon at the windows task bar for your application
API Declarations
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Public Type NOTIFYICONDATA
CbSize As Long
HWnd As Long
Uld As Long
Uflags As Long
UcallbackMessage As Long
HIcon As Long
SzTip As String * 64
End Type
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const WM_MOUSEMOVE = &H200
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_LBUTTONBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const wm_rbuttondblclk = &H206
Public Const wm_rbuttondown = &H204
Public Const wm_rbuttonup = &H205
Dim t As NOTIFYICONDATA '
t.CbSize = Len(t)
t.HWnd = pichook.HWnd
t.Uld = 1&
t.Uflags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
t.UcallbackMessage = WM_MOUSEMOVE
t.HIcon = Me.Icon '<-- icon
t.SzTip = "shell notify icon...." & Chr$(0) '<--tip
Shell_NotifyIcon NIM_ADD, t
Me.Hide
App.TaskVisible = False
End Sub
Private Sub mnumain_Click()
Unload Me
End Sub
Private Sub pichook_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static rec As Boolean, msg As Long
msg = X / Screen.TwipsPerPixelX
If rec = False Then
rec = True
Select Case msg
Case WM_LBUTTONDOWN
MsgBox "double click"
Case wm_rbuttonup
Me.PopupMenu mnubar '<<----right click (pop up menu( form1 menu))
End Select
rec = False
End If
End Sub
No comments have been posted about adds a notify icon at the windows task bar for your application. Why not be the first to post a comment about adds a notify icon at the windows task bar for your application.