VB and VBA Users Source Code: Show and hide the windows task bar
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Show and hide the windows task bar
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Sunday, January 14, 2001
Hits:
593
Category:
Windows API
Article:
The following routine shows and hides the Windows Task Bar: Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long 'Purpose : Shows and hides the task bar 'Inputs : [bVisible] If True shows the Task Bar, else hides the Task Bar 'Outputs : Returns 16 if Task Bar hidden else returns zero 'Author : Andrew Baker 'Date : 14/01/2001 12:14 'Notes : 'Revisions : Function TaskBarVisible(Optional bVisible As Boolean = False) As Long Dim lhWnd As Long, lState As Long Const SW_NORMAL = 1, SW_HIDE = 0 lhWnd = FindWindow("Shell_TrayWnd", "") If lhWnd = 0 Then Exit Function If bVisible Then lState = SW_NORMAL 'show it Else lState = SW_HIDE 'hide it End If TaskBarVisible = ShowWindow(lhWnd, lState) End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder