Torna al Thread
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Private Shared Function FindWindow(ByVal className As String, ByVal windowName As String) As IntPtr
End Function
Structure Rect
Dim left As Integer
Dim top As Integer
Dim right As Integer
Dim bottom As Integer
End Structure
<DllImport("user32.dll")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef rect As Rect) As Boolean
End Function
Private Sub TuaForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Ottiene l'handle della system tray
Dim tray As IntPtr = FindWindow("Shell_TrayWnd", Nothing)
'Ottiene il rettangolo della system tray
Dim trayRect As New Rect
GetWindowRect(tray, trayRect)
'ottiene il rettangolo gestito
Dim rect As Rectangle = Rectangle.FromLTRB(trayRect.left, trayRect.top, trayRect.right, trayRect.bottom)
'imposta il punto di visualizzazione
Me.Top = Screen.PrimaryScreen.Bounds.Bottom - rect.Height - Me.Height
Me.Left = Screen.PrimaryScreen.Bounds.Right - Me.Width
End Sub