home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modTest"
- Option Explicit
-
- 'Author: Cris Williams
- ' 74451.1245@compuserve.com
- '
- ' Are you a Lotus Ami Pro user? If so, check out HelpMaker for Ami Pro
- ' found on Compuserve and on several sites on the Internet. HelpMaker is
- ' a WinHelp authoring tool specifically for use with Ami Pro. A Lotus
- ' Word Pro version is soon to follow.
- ' (pardon the plug)
- '
- ' This sample application is designed to demonstrate the functionality of adding
- ' an icon to the Win95 taskbar using Visual Basic 4.0. It also demonstrates the
- ' usage of Message Blaster to receive Windows messages generated by mouse events
- ' which occur on the taskbar icon.
-
- Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
- Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
-
- Public Const NIF_ICON = &H2
- Public Const NIF_MESSAGE = &H1
- Public Const NIF_TIP = &H4
- Public Const NIM_ADD = &H0
- Public Const NIM_DELETE = &H2
- Public Const pnTOOLTIP_SZ As Integer = 64
-
- Type NOTIFYICONDATA
- cbSize As Long
- hwnd As Long
- uID As Long
- uFlags As Long
- uCallbackMessage As Long
- hIcon As Long
- szTip As String * pnTOOLTIP_SZ
- End Type
-
- Public ptIconData As NOTIFYICONDATA
-
- Sub AddIcon(oWindow As Object, lMsg As Long, sTooltip As String)
-
- On Error Resume Next
-
- Dim lResult As Long
-
- With ptIconData
- .cbSize = Len(ptIconData)
- .hwnd = oWindow.hwnd
- .uID = oWindow.Icon
- .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
- .uCallbackMessage = lMsg
- .hIcon = oWindow.Icon
- .szTip = sTooltip & Chr$(0)
- End With
-
- lResult = Shell_NotifyIcon(NIM_ADD, ptIconData)
-
- End Sub
-
- Sub DelIcon()
-
- On Error Resume Next
-
- Dim lResult As Long
-
- lResult = Shell_NotifyIcon(NIM_DELETE, ptIconData)
-
- End Sub
-
-
-
- Sub Main()
-
- Load frmTaskbar
-
- End Sub
-
-
-