Hallo!
Wie kann ich unter VB.NET ermitteln, wo der Benutzer die Startleiste positioniert hat, wie groß diese ist und welche Schnellstart-Leisten er aktiviert hat?!
Die Position konnte man unter VB6 ungefähr so ermitteln, das klappt aber nicht mehr...
Vielen Dank!
Nico Stöckigt
Wie kann ich unter VB.NET ermitteln, wo der Benutzer die Startleiste positioniert hat, wie groß diese ist und welche Schnellstart-Leisten er aktiviert hat?!
Die Position konnte man unter VB6 ungefähr so ermitteln, das klappt aber nicht mehr...
Code:
----------8<---------- Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, _ ByVal lpRect As Rectangle) As Long Public Function GetTaskBarPosition() As eTaskBarProperty Dim hRect As Rectangle Dim hwnd As Long Dim hRes As Long hwnd = FindWindow("Shell_traywnd", "") hRes = GetWindowRect(hwnd, hRect) ' Handle TBarWindow ermitteln If hRect.Top < 1 Then If hRect.Left < 1 Then If hRect.Bottom > hRect.Right Then GetTaskBarPosition = eTaskBarProperty.Left If hRect.Right > hRect.Bottom Then GetTaskBarPosition = eTaskBarProperty.Top End If End If If hRect.Top < 1 Then If hRect.Left > 0 Then GetTaskBarPosition = eTaskBarProperty.Right End If If hRect.Left < 1 Then If hRect.Top > 0 Then GetTaskBarPosition = eTaskBarProperty.Bottom End If End Function ----------8<----------
Nico Stöckigt