2012年1月12日 星期四

VB.Net-如何以程式設計方式隱藏及取消隱藏 Windows 工作列(分享)

網路上找到的可以消除工作列的一種方式


Dim handleW1 As Long

Private Declare Function FindWindowA Lib "user32" _
   (ByVal lpClassName As String, _
   ByVal lpWindowName As String) As Long

Private Declare Function SetWindowPos Lib "user32" _
   (ByVal handleW1 As Long, _
   ByVal handleW1InsertWhere As Long, ByVal w As Long, _
   ByVal x As Long, ByVal y As Long, ByVal z As Long, _
   ByVal wFlags As Long) As Long

Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40

Function HideTaskbar()
   handleW1 = FindWindowA("Shell_traywnd", "")
   Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
End Function

Function UnhideTaskbar()
   Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
End Function


沒有留言:

張貼留言