wince 隱藏任務欄

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章