Disable the Windows Taskbar

By | 2002-06-01

Disable the Taskbar

Original Author: StonePage

API Declarations

Dim hwnd1 As Long
Private Declare Function SetWindowPos Lib “user32” _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As _
Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags
_As Long) As Long
Private Declare Function FindWindow Lib “user32” _
Alias “FindWindowA” (ByVal lpClassName As String, ByVal lpWindowName _
As String) As Long
Const SWP_HIDEWINDOW &H80
Const SWP_SHOWWINDOW &H40

Code

3. Add a Command Button control to Form1. Command1 is created by
default. Set its Caption property to "Hide".
4. Add the following code to the Click event for Command1.
Private Sub Command1_Click()
hwnd1 = FindWindow("Shell_traywnd", "")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub
5. Add a second Command Button control to Form1. Command2 is created by
default. Set its Caption property to "Show".
6. Add the following code to the Click event for Command2.
Private Sub Command2_Click()
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.