i want my program to be running all the time, but be minimized to the SysTray, does anyone know how do do that, and open it when it is double clicked? thanks in advance
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
'I don't want to terminate the app
Set TI = New cTrayIcon
With TI
.SetPct pctTray
.CreateIcon "This is my app"
End With
Me.Hide
Cancel = 1
End If
End Sub
Private Sub TI_TrayIconDoubleCLick()
TI.DeleteIcon
Set TI = Nothing
Me.Show
End Sub
Private Sub Form_Unload(Cancel As Integer)
TI.DeleteIcon
Set TI = Nothing
End Sub
pctTray is a picturebox (invisible) with the icon you want to show in the Systray.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Originally posted by Jennifer_R mc Brain,
what is or where do I find cTrayIcon? I'm assuming it's a class that I need to reference.
It's a Class I created, based on some examples I found over here... and I guess you've already found it attached on my previous reply.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Don't you need to add the call to CheckTray sub on the MouseDown event or similar as well to get the popmenu shown??
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Umm yeah, I should probably comment my code better:
Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static lngMsg As Long
Static blnFlag As Boolean
Dim result As Long
lngMsg = X / Screen.TwipsPerPixelX
If lngMsg = WM_LBUTTONDBLCLICK Or lngMsg = WM_RBUTTONUP Then
' tmp = tmp
End If
CheckTray Me, lngMsg, blnFlag, result
End Sub
I'm pretty sure that's everything (now)
Another point:
The name of the form will be the tool-tip for the tray icon.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Originally posted by Lord_Rat
Another point:
The name of the form will be the tool-tip for the tray icon.
You could use its tag instead, just in case you want another tooltip for the icon.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.