HOWTO: Determine if the Windows95 Taskbar is Visible/HiddenLast reviewed: July 17, 1997Article ID: Q143117 |
The information in this article applies to:
SUMMARYThe Windows 95 taskbar allows 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.
MORE INFORMATION
Windows 95 TaskbarThe taskbar in Windows 95 is an area of the screen that contains icons that let you easily switch from one application to another, launch new applications, or display status information. You can customize certain aspects of the taskbar. From the Start menu, select Settings/Taskbar. Windows 95 will display the current settings for the taskbar. For example, if you set the AutoHide option, the taskbar is always hidden from view. To see the taskbar, you simply move the mouse pointer over that area of the screen where the taskbar is located. The taskbar immediately pops into view. In a Visual Basic program, you can use the SHAppBarMessage function to determine if the taskbar is visible or hidden. To use the SHAppBarMessage function in your program, you must include the following declare statement in the general declarations section of your program:
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As LongThe SHAppBarMessage function requires two arguments. The first argument identifies the appbar message you want to send. The dwMessage argument may be set to one of the following values:
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 appbarABM_WINDOWPOSCHANGED Notifies the system when an appbar's position has changedThe second argument required by the SHAppBarMessage function is a pointer to an APPBARDATA structure. The actual contents of this structure depends on the message you send to the system. Because you are retrieving the state of the taskbar, you do not need set any of the fields in the APPBARDATA structure. Just set the dwMessage argument to the constant value ABM_GETSTATE to retrieve the current state of the taskbar. After you call the SHAppBarMessage function, a value is returned indicating the state of the taskbar. If this value is zero, you know the taskbar is not in auto-hide or always-on-top mode. If the value returned is &H1, the taskbar is in auto-hide mode and if the value returned is &H2, the taskbar is in always-on-top mode.
How to Create the Demonstration ProgramThe demonstration program below shows how to determine if the taskbar in Windows 95 is visible or hidden.
REFERENCESProduct 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: task bar auto hide vb5howto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |