How set auto-hide taskbar with ABM_SETAUTOHIDEBAR only

How set auto-hide taskbar with ABM_SETAUTOHIDEBAR only

Post by Sebastien Dionn » Wed, 30 Jun 1999 04:00:00



I want set auto-hide the taskbar in my application.  I dont want to use the
function Findwindows..setposition... is useless for me.

I try lot of code and i'm still not able..I really need help

try this code, you need a command1 and a module
'-----------------FORM----------------------------------------------

Private Sub Command1_Click()
Dim abd As APPBARDATA
Dim ret As Boolean

m_hWnd = FindWindow("Shell_traywnd", "")

With abd
            .cbSize = Len(abd)
            .hWnd = m_hWnd

        End With
        ret = SHAppBarMessage(ABM_GETAUTOHIDEBAR, abd)

        With abd
            .cbSize = Len(abd)
            .hWnd = m_hWnd
            .lParam = True
        End With
        ret = SHAppBarMessage(ABM_SETAUTOHIDEBAR, abd)
        '
            abd.lParam = 0
            abd.rc.Bottom = 0
            abd.rc.Left = 0
            abd.rc.Right = 0
            abd.rc.Top = 0
            ret = SHAppBarMessage(ABM_SETPOS, abd)
        '
        'ret = SHAppBarMessage(ABM_WINDOWPOSCHANGED, abd)

End Sub

'------------------MODULE---------------------------------------------------
-----------------

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

Public Type APPBARDATA
    cbSize              As Long ' sizeof(APPBARDATA)
    hWnd                As Long ' handle of appbar
    uCallbackMessage    As Long ' Application-defined message identifier.
                                ' The application uses the specified
identifier for notification messages
                                ' that it sends to the the appbar identified
by the hWnd member.
                                ' This member is used when sending the
ABM_NEW message
    uEdge               As Long ' Flag that specifies an edge of the screen.
                                ' This member can be one of the following
values:
                                ' ABE_LEFT, ABE_RIGHT, ABE_BOTTOM, ABE_TOP
    rc                  As RECT ' RECT structure that contains the bounding
rectangle,
                                ' in screen coordinates, of an appbar or the
Windows taskbar.
                                ' This member is used when sending the
ABM_GETTASKBARPOS, ABM_QUERYPOS, and ABM_SETPOS messages
    lParam              As Long ' Message-dependent value.
                                ' This member is used with the
ABM_SETAUTOHIDEBAR message
End Type

Public Declare Function SHAppBarMessage Lib "shell32.dll" _
    (ByVal dwMessage As Long, pData As APPBARDATA) As Long

Public Declare Function SetWindowPos Lib "user32" _
    (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, _
    ByVal X As Long, ByVal Y As Long, _
    ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Const ABM_GETAUTOHIDEBAR = &H7
Public Const ABM_SETAUTOHIDEBAR = &H8
Public Const ABM_SETPOS = &H3

--
Sbastien Dionne
Stagiaire Simlog
www.simlog.com

--
Sbastien Dionne
Stagiaire Simlog
www.simlog.com