PDA

Click to See Complete Forum and Search --> : How to make a tray-popup?


mwdelta
Dec 2nd, 1999, 11:11 AM
One last question. I need to make a small window popup near the system tray when the user moves the mouse over my tray icon, and then disappear when they move the mouse away. Making it popup is easy, but getting it to disappear seems impossible. Also, the window needs to popup right above the taskbar, so is there any way to find out the taskbar height? I have seem this before in some Norton software. As always, whoever solves this problem for me gets a free copy of Workload 2000 ($19.95 value) when it's finished. Workload helps manage your projects and earnings.

Thanks again for all your help!

------------------
Mike Wellems
PowerQuery

Steve Stunning
Dec 3rd, 1999, 02:36 AM
There are some samples out there that will show you how to get the bar height. I had one a while ago but no longer have it.

If you do a search.... You will find your answer.. :)

Jakys
Dec 3rd, 1999, 08:05 PM
Do it the common way:
When you rightclick on the trayicon, the popup appear, and when you click somewere else it disappear.

If you find the code to make it disappear someday, make an update or something.

The sysinfo-control might tell you the taskbarheight.

Jakys

[This message has been edited by Jakys (edited 12-04-1999).]

[This message has been edited by Jakys (edited 12-04-1999).]

Frans C
Dec 3rd, 1999, 09:09 PM
For the heigth of the taskbar try this

Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long


Private Sub Command1_Click()
Dim retVal As Long
Dim Size As RECT
retVal = FindWindow("Shell_TrayWnd", vbNullString)
Call GetClientRect(retVal, Size)
MsgBox "Heigth of Taskbar : " & Size.Bottom & " Pixels"
Call GetWindowRect(retVal, Size)
MsgBox "Position of Taskbar:" & vbCrLf & "Left :" & Size.Left & vbCrLf & "Right : " & _
Size.Right & vbCrLf & "Top : " & Size.Top & vbCrLf & "Bottom : " & Size.Bottom
End Sub