Welcome to Dream.In.Code
Become a VB Expert!

Join 149,471 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,923 people online right now. Registration is fast and FREE... Join Now!




icons on tray...

 
Reply to this topicStart new topic

icons on tray...

edward_pogi123
24 Jan, 2008 - 02:45 AM
Post #1

New D.I.C Head
*

Joined: 24 Nov, 2007
Posts: 7


My Contributions
how do i display an icon of my application in the system tray/notification tray /area (or whatever they call it) of the taskbar?
User is offlineProfile CardPM
+Quote Post

nealgabriel45
RE: Icons On Tray...
24 Jan, 2008 - 03:53 AM
Post #2

New D.I.C Head
Group Icon

Joined: 22 Oct, 2007
Posts: 46


Dream Kudos: 50
My Contributions
CODE

'API used to display Icon in sys tray

Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" _
    (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean

'The Type used in the API.  

Private 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
Dim nid as NOTIFYICONDATA
  'Add icon to system tray
    With nid
        .cbSize = Len(nid)
        .hWnd = Me.hWnd
        .uId = vbNull
        .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
        .uCallBackMessage = WM_MOUSEMOVE
        .hIcon = Me.Icon
        .szTip = ToolTip & vbNullChar
    End With
    Call Shell_NotifyIcon(NIM_ADD, nid)


EDIT: Please, always use code tags when posting code, like so => code.gif , second, we have a strict policy about giving code out to those who have made no attempt to solve their problem, by posting the code they've used to try and resolve their issue, so please in the future follow that policy please smile.gif

This post has been edited by PsychoCoder: 24 Jan, 2008 - 05:45 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 02:35PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month