borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincani
:: How to Hide/Show the Windows Task Bar and the Desktop...

Author  

Andrea Tincani

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
API Declarations

Private Declare Function ShowWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function EnableWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal fEnable As Long) As Long

Public Const SW_HIDE = 0
Public Const SW_SHOW = 5

Module

Public Sub TaskBar(Visible As Boolean)
    Dim hWnd As Long

    hWnd = FindWindow("Shell_TrayWnd", "")
    If Visible Then
        ShowWindow hWnd, SW_SHOW
    Else
        ShowWindow hWnd, SW_HIDE
    End If
    EnableWindow hWnd, Visible
End Sub

Public Sub Desktop(Visible As Boolean)
    Dim hWnd As Long

    hWnd = FindWindow("Progman", "Program Manager")
    If Visible Then
        ShowWindow hWnd, SW_SHOW
    Else
        ShowWindow hWnd, SW_HIDE
    End If
    EnableWindow hWnd, Visible
End Sub

:: Navigation

Home

Miscellaneous API Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 30-06-2006 Re: Mdi minimize,maximize by yronium
icon 24-02-2006 please tell me why my customer form gets hung up by kabba
icon 06-09-2005 Re: hide shutdown,...? by admin
icon 19-08-2005 Re: an impossible thing(Loading cmd commands output to text file) by dreamvb
icon 30-01-2005 Re: MDI child always on top of another MDI child by Goran
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder