Results 1 to 5 of 5

Thread: System tray

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    System tray

    How can add image in system tray menu something like sidebar(verticle image)?.. is there any sample .. plz help

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: System tray

    do a search for SysTray or System Tray, you'll find tonnes of hits

  3. #3
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: System tray

    Here is an example. I have not tested it because my college does not have Vb installed yet, so i am current stuck with office, there forms do not support icons or hWnd so.

    Here is the code as far as i remember it. i has been a long time since i have used it.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" ( _
    4.         ByVal dwMessage As Long, _
    5.         pnid As NOTIFYICONDATA) _
    6.         As Long
    7.  
    8. Private Type NOTIFYICONDATA
    9.     cbSize As Long
    10.     hWnd As Long
    11.     uId As Long
    12.     uFlags As Long
    13.     ucallbackMessage As Long
    14.     hIcon As Long
    15.     szTip As String * 64
    16. End Type
    17.  
    18. Private Const NIM_ADD = &H0
    19. Private Const NIM_MODIFY = &H1
    20. Private Const NIM_DELETE = &H2
    21. Private Const NIF_MESSAGE = &H1
    22. Private Const NIF_ICON = &H2
    23. Private Const NIF_TIP = &H4
    24.  
    25. Private Const WM_LBUTTONDBLCLK = &H203
    26. Private Const WM_LBUTTONDOWN = &H201
    27. Private Const WM_RBUTTONUP = &H205
    28.  
    29. Private Sub Form_Load()
    30.     Dim NID As NOTIFYICONDATA
    31.    
    32.     'Set the data
    33.     With NID
    34.         .cbSize = Len(NID)
    35.         .hIcon = Me.Icon
    36.         .hWnd = Me.hWnd
    37.         .szTip = "Tray Application" & vbNullChar
    38.         .ucallbackMessage = WM_LBUTTONDBLCLK
    39.         .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
    40.         .uId = 1&
    41.     End With
    42.     'Add the Icon
    43.     Shell_NotifyIcon NIM_ADD, NID
    44. End Sub
    45.  
    46. Private Sub Command1_Click()
    47.     Shell_NotifyIcon NIM_DELETE, NID
    48. End Sub

    Hope this helps

    Jenova

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: System tray

    Thanks Jenova for the help but i want something else your code is simple tray menu sample but I want image in left side vertical image … there are sample for menu but not for tray menu….
    I want something like this
    http://www.vbaccelerator.com/home/vb...e/icqpmenu.gif

    but this is not tray menu
    Last edited by xor83; Sep 12th, 2006 at 07:46 AM.

  5. #5
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: System tray

    a systray menu isn't any different to a normal menu - so just use the vbAccelerator code

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