Show or hide the Start button
By: Waty Thierry Date: 22/10/1998

With this code snippet you can show or hide the Start button (usually located at the lower left corner of the screen).
First copy the following declarations in a module:

Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
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
Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Then cut and paste the following functions in the same module:

Public Function HideStartButton()
   OurParent& = FindWindow("Shell_TrayWnd", "")
   OurHandle& = FindWindowEx(OurParent&, 0, "Button", _
    vbNullString)
   ShowWindow OurHandle&, 0
End Function

Public Function ShowStartButton()
   OurParent& = FindWindow("Shell_TrayWnd", "")
   OurHandle& = FindWindowEx(OurParent&, 0, "Button", _
    vbNullString)
   ShowWindow OurHandle&, 5
End Function

The use is very easy, just type ...

Call HideStartButton

... to hide the button, and ...

Call ShowStartButton

... to show it again.
If you want to jest disable the Start key or the CTRL+ESC combination, without hiding the Start button, see Disable the Start key.


Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
To contact the Webmaster, click here.
Hosted by InWind: www.inwind.it