Click to See Complete Forum and Search --> : System Tray
pfridm01
Feb 28th, 2001, 12:04 PM
Hi,
How do you set and control System Tray Icons from VB application.
Thanks
Rh0ads
Feb 28th, 2001, 02:52 PM
Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Public Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Sub Icon_Add(Name As NOTIFYICONDATA, Icn As Object, Txt As String)
Name.cbSize = Len(Name)
Name.hWnd = form11.hWnd
Name.uId = vbNull
Name.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
Name.ucallbackMessage = WM_MOUSEMOVE
Name.hIcon = Icn
Name.szTip = Txt & Chr$(0)
Call Shell_NotifyIcon(NIM_ADD, Name)
End Sub
here's an example of how to use that cub:
Dim try as NOTIFYICONDATA
Call Icon_Add(try,Picture1.Picture,"Text")
groovydaz
Feb 28th, 2001, 02:59 PM
Does anyone know how to control other applications system tray icons? such as load them up from the tray or access their menus.
Darren.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.