VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 隐藏和显示任务栏
发表评论(0)作者:, 平台:, 阅读:14773, 日期:2000-03-12
任务栏一般是显示在窗口的最底下,但有时我们需要隐藏它。

声明:

Dim hWnd1 As Long

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

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const SWP_HIDEWINDOW = &H80

Const SWP_SHOWWINDOW = &H40

隐藏的例子:

hWnd1 = FindWindow("Shell_traywnd", "")

Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

显示的例子:

Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)