View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bearacade[_10_] Bearacade[_10_] is offline
external usenet poster
 
Posts: 1
Default Auto Hide Task Bar


I am having a brain fart, I could for the LIFE of me figure out wha
task bar was.. haha.. ok.. here goes.. put all of this in ThisWorkbook


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

Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Sub TaskBar(blnValue As Boolean)
Dim lngHandle As Long
Dim lngStartButton As Long

lngHandle = FindWindow("Shell_TrayWnd", "")

If blnValue Then
ShowWindow lngHandle, 5
Else
ShowWindow lngHandle, 0
End If
End Sub

Private Sub Cmdhide()
Dim A As Boolean
A = False
TaskBar (A)
End Sub

Private Sub Cmdunhide()
Dim A As Boolean
A = True
TaskBar (A)
End Sub

Private Sub Workbook_Open()

Call Cmdhide

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Call Cmdunhide

End Su

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=55003