Wednesday, April 29, 2009

App Bar Message

'App Bar Message


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()

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



 

No comments:

Post a Comment