Results 1 to 3 of 3

Thread: System Tray

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    phila
    Posts
    2

    Angry

    Hi,
    How do you set and control System Tray Icons from VB application.
    Thanks

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    Code:
    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:
    Code:
    Dim try as NOTIFYICONDATA
    Call Icon_Add(try,Picture1.Picture,"Text")
    < o >

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Posts
    78
    Does anyone know how to control other applications system tray icons? such as load them up from the tray or access their menus.

    Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width