HOWTO: Determine if Windows 95/98 Taskbar Is Visible/HiddenID: Q143117
|
Both the Windows 95 and Windows 98 taskbar allow you to easily launch Windows application programs and to determine which applications are currently executing. The taskbar can also display status information, such as the current time. This article will explain how you can determine, from within a Visual Basic program, if the taskbar is visible or hidden.
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal
dwMessage As Long, pData As APPBARDATA) As Long
Value Description
------------------------------------------------------------------
ABM_ACTIVATE Notifies the system that an appbar has been
activated.
ABM_GETAUTOHIDEBAR Retrieves the handle of the autohide appbar
associated with a particular edge of the screen
ABM_GETSTATE Retrieves the autohide and always-on-top states of
the windows taskbar
ABM_GETTASKBARPOS Retrieves the bounding rectangle of the Windows
taskbar.
ABM_NEW Registers a new appbar and specifies the message
identifier that the system should use to send
notification messages to the appbar.
ABM_QUERYPOS Requests a size and screen position for an appbar
ABM_REMOVE Unregisters an appbar, removing bar from the
system's internal list
ABM_SETAUOTOHIDEBAR Registers or unregisters an autohide appbar for an
edge of the screen
ABM_SETPOS Sets the size and screen position of an appbar
ABM_WINDOWPOSCHANGED Notifies the system when an appbar's position has
changed
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal _
dwMessage As Long, pData As APPBARDATA) As Long
Const ABS_ALWAYSONTOP = &H2
Const ABS_AUTOHIDE = &H1
Const ABM_GETSTATE = &H4
Private Sub Command1_Click()
Dim IsThere As Integer
IsThere = BarExists()
If IsThere = 0 Then
Text1.Text = "TaskBar not in auto-hide or always-on-top mode"
End If
If IsThere = ABS_ALWAYSONTOP Then
Text1.Text = "TaskBar always-on-top"
End If
If IsThere = ABS_AUTOHIDE Then
Text1.Text = "TaskBar in auto-hide"
End If
End Sub
Public Function BarExists() As Integer
Dim Bardata As APPBARDATA
BarExists = SHAppBarMessage(ABM_GETSTATE, Bardata)
End Function
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long ' message specific
End Type
Product Documentation, SDKs, Win32 SDK, Win32, Reference, Messages.
ABM_GETSTATE.
Product Documentation, SDKs, Win32 SDK, Win32, Reference, Structures,
ABC to CWPRETSTRUCT. APPBARDATA.
Product Documentation, SDKs, Win32 SDK, Guides, Programmer's Guide to
Windows 95.
Additional query words: kbVBp400 kbVBp500 kbVBp kbDSupport kbdsd kbSDKWin32 kbVBp600 KBWIN32SDK KBAPI
Keywords :
Version :
Platform : NT WINDOWS
Issue type :
Last Reviewed: June 2, 1999