ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Task Bar Problem (https://www.excelbanter.com/excel-discussion-misc-queries/108189-task-bar-problem.html)

basketcase63

Task Bar Problem
 
Is there a way to permanently hide the taskbar and have it appear only with a
series of control keys?

Jim Thomlinson

Task Bar Problem
 
While I would personally recommend against doing this (changing the
environment is problematic especially if the code crashes) here is some code
to hide and unhide the task bar. Place it in a standard code module...

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_Click()

TaskBar (False)
End Sub

Private Sub Cmdunhide_Click()
TaskBar (True)
End Sub

--
HTH...

Jim Thomlinson


"basketcase63" wrote:

Is there a way to permanently hide the taskbar and have it appear only with a
series of control keys?


basketcase63

Task Bar Problem
 
Thank you so much. I would not recommend anyone do this either unless they
have the special circumstances we have. This particular computer is in a
shelter for use by the children. Some of the children are quite the astute
future programmers and are able to get into administration through the task
bar and change the controls. We have tried everything we can think of to be
able to prevent this from happening. So this is a "last resort" effort.

"Jim Thomlinson" wrote:

While I would personally recommend against doing this (changing the
environment is problematic especially if the code crashes) here is some code
to hide and unhide the task bar. Place it in a standard code module...

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_Click()

TaskBar (False)
End Sub

Private Sub Cmdunhide_Click()
TaskBar (True)
End Sub

--
HTH...

Jim Thomlinson


"basketcase63" wrote:

Is there a way to permanently hide the taskbar and have it appear only with a
series of control keys?



All times are GMT +1. The time now is 03:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com