Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| 'System & API - How to Show/Hide the Start Button from the task bar
Option Explicit
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
Private Const BUT_SHOW = 5
Private Const BUT_HIDE = 0
Public Sub HideStartButton(ByVal bHide As Boolean)
Dim Butttonhwnd As Long
Butttonhwnd = FindWindow("Shell_TrayWnd", "")
Butttonhwnd = FindWindowEx(Butttonhwnd, 0, "Button", vbNullString)
If bHide Then
ShowWindow Butttonhwnd, BUT_HIDE 'To Hide
Else
'To show the Start Button
ShowWindow Butttonhwnd, BUT_SHOW 'To Show
End If
End Sub |