感谢csdn里面wuyazhe老兄将我的c++代码解释为vb.net。
Public Declare Function IsWindowVisible Lib "coredll.dll" (ByVal hwnd As Integer) As Boolean Public Declare Function FindWindow Lib "coredll.dll" (ByVal lpClassName As String,ByVal lpWindowName As String) As IntPtr Public Declare Function ShowWindow Lib "coredll.dll" (ByVal hwnd As IntPtr,ByVal nCmdShow As Integer) As Integer Public Const SW_HIDE = 0 Public Const SW_SHOWNORMAL = 1 Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click Dim htask As IntPtr = FindWindow("HHTaskBar",Nothing) If Not IsWindowVisible(htask) Then ShowWindow(htask,SW_SHOWNORMAL) Else ShowWindow(htask,SW_HIDE) End If End Sub