does any1 know how to make a app when u minimize it insted ov going to da bottom of screen to go as an icon near clock like the msn messinger icon

Recommended Answers

All 7 Replies

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.

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

you have to add the structure of that API also when you add the API itself.

i did

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

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

it does understand the public declere function line

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.