Imports System.Runtime.InteropServices
<DllImport("coredll.dll")> _
Friend Shared Function IsWindowVisible(ByVal hwnd As Integer) As Boolean
End Function
<DllImport("coredll.dll")> _
Friend Shared Function FindWindow(ByVal lpClassName As String,ByVal lpWindowName As String) As Integer
End Function
<DllImport("coredll.dll")> _
Friend Shared Function EnableWindow(ByVal hwnd As Integer,ByVal fEnable As Integer) As Integer
End Function
<DllImport("coredll.dll")> _
Friend Shared Function ShowWindow(ByVal hwnd As Integer,ByVal nCmdShow As Integer) As Integer
End Function
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Private Sub btnHide_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnHide.Click '屏蔽系统任务栏 Dim htask As IntPtr = FindWindow("HHTaskBar",Nothing) If Not IsWindowVisible(htask) Then ShowWindow(htask,SW_SHOWNORMAL) Else EnableWindow(htask,False) ShowWindow(htask,SW_HIDE) End If End Sub