Const ABS_AUTOHIDE = &H1
Const ABS_ONTOP = &H2
Const ABM_GETSTATE = &H4
Const ABM_GETTASKBARPOS = &H5
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
Private Type APPBARDATA
    cbSize As Long
    hwnd As Long
    uCallbackMessage As Long
    uEdge As Long
    rc As RECT
    lParam As Long ' message specific
End Type
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Private Sub Form_Paint()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim ABD As APPBARDATA, Ret As Long
    'Get the taskbar's position
    SHAppBarMessage ABM_GETTASKBARPOS, ABD
    'Get the taskbar's state
    Ret = SHAppBarMessage(ABM_GETSTATE, ABD)
    If (Ret And ABS_AUTOHIDE) Then Me.Print "Autohide option is on"
    If (Ret And ABS_ONTOP) Then Me.Print "Always on top option is on"
    Me.Print "Taskbar coordinates: (" + Trim(Str(ABD.rc.Left)) + "," + Trim(Str(ABD.rc.Top)) + ")-(" + Trim(Str(ABD.rc.Right)) + "," + Trim(Str(ABD.rc.Bottom)) + ")"
End Sub

Close this window