How to Popup a Window near the Tray Icons, like the one in MSN Messenger...
Hi Guys,
How should I Popup a Form near the Taskbar to notify a Message, like the one in MSN Messenger (a new window will popup when some person log in or when some New Message Arrives). Also it should be popped up upon the Taskbar. When the Taskbar is hidden then it should popup from the Bottom of the Screen. Do Anyone have any Idea of doing this...Thnx in advance.
How to Control the Speed of Appearence
Hi Serge,
Thnx for ur code. I got it working. But I need to Control the Speed of Appearence of the Window. ie., i want it to rise slowly Upwards. I hope you would've seen this effect in MSN Messenger. Is it Possible to get this. Thnx again.
Hi Serge, I did this with a Timer...
Hi Serge,
I tried this with a Timer and found it to be easier than ur code. Anyway Thanks a Lot for ur code.
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Dim rec As RECT
Dim lngHwnd As Long
Dim lngWidth As Long
Dim lngHeight As Long, TempTop As Long, SecTop As Long
Private Sub Command1_Click()
Timer4.Enabled = True
End Sub
Private Sub Form_Activate()
lngHwnd = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)
Call GetWindowRect(lngHwnd, rec)
lngWidth = Me.ScaleX(Me.Width, vbTwips, vbPixels)
lngHeight = Me.ScaleY(Me.Height, vbTwips, vbPixels)
Call MoveWindow(Me.hwnd, rec.Right - lngWidth, rec.Top - lngHeight, lngWidth, lngHeight, 1)
TempTop = Me.Top
Me.Top = Me.Top + Me.Height
Me.Left = Me.Left - 100
End Sub
Private Sub Timer1_Timer()
Me.Top = Me.Top - 50
If Me.Top <= TempTop Then
Timer1.Enabled = False
SecTop = Me.Top
MMC.Command = "Close"
End If
End Sub
Private Sub Timer4_Timer()
Me.Top = Me.Top + 50
If Me.Top = TempTop Then
Timer4.Enabled = False
Unload Me
End If
End Sub