Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Taskbar Autohide
#1
Hi,

The following vba code sets the taskbar to autohide or not. How would I convert this to Quick Macros?
Code:
Copy      Help
Public Declare Function SHAppBarMessage Lib "shell32" (ByVal dwMessage As Long, pData As APPBARDATA) As Long

Public Const ABM_GETSTATE = &H4
Public Const ABM_SETSTATE = &HA
Public Const ABS_AUTOHIDE = &H1
Public Const ABS_ALWAYSONTOP = &H2

Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Public Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long
End Type

Sub SetTaskbarAutohide(state As Boolean)
    Dim ABD As APPBARDATA
    ABD.cbSize = Len(ABD)
    SHAppBarMessage ABM_GETSTATE, ABD
    If state Then
        ABD.lParam = ABS_AUTOHIDE
    Else
        ABD.lParam = ABS_ALWAYSONTOP
    End If
    SHAppBarMessage ABM_SETSTATE, ABD
End Sub

Thanks!

Tony


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)