3
Contributors
7
Replies
8
Views
10 Years
Discussion Span
Last Post by scrypt3r
0

This icon position is usually called the Tray Icon. To do this you have to make use of some API calls. You have to use Shell_NotifyIconA() to set the Tray Icon. This is how you set the tray.

Before making calls to the function you need to declare the API

Public Declare Function Shell_NotifyIconA Lib "shell32.dll" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long

Private Sub AddTrayIcon()

Dim nid As NOTIFYICONDATA

' nid.cdSize is always Len(nid)
nid.cbSize = Len(nid)
' Parent window - this is the window that will process the icon events
nid.hWnd = frmSystray.hWnd
' Icon identifier
nid.uID = 0
' We want to receive messages, show the icon and have a tooltip
nid.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
' The message we will receive on an icon event
nid.uCallbackMessage = 1024
' The icon to display
nid.hIcon = frmSystray.Icon
' Our tooltip
nid.szTip = "Always terminate the tooltip with vbNullChar" & vbNullChar

' Add the icon to the System Tray
Shell_NotifyIconA NIM_ADD, nid

' Prevent further adding
cmdAddIcon.Enabled = False
End Sub

Private Sub cmdAddIcon_Click()
AddTrayIcon
End Sub

Let me know.

0

It doesnt recognize
NOTIFYICONDATA
NIF_MESSAGE Or NIF_ICON Or NIF_TIP
frmSystray
cmdAddIcon
NIM_ADD

0

You can change the form name "frmSystray" to your main form name. and also add a button named "cmdAddIcon" on your main form. When you click this button your form would goto the Tray Icon

0

I started a similar thread 17 days ago it's called
minimize form
maybe the answers I got will help you

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.