隐藏Windows状态栏
程序功能:本程序用来隐藏Windows状态栏,或者在隐藏Windows状态栏后再显示状态栏。
程序用途:有时,可能想在应用程序运行过程中禁用Windows任务栏,可以将本程序代码与一些其它的过程联合起来,临时隐藏Windows任务栏。
程序代码:
Option Explicit
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
程序分析:程序代码使用了API和Windows常量。
程序说明:在工作表中,使用窗体工具栏创建两个按钮,分别赋给宏
示例下载:http://www.drexcel.cn/article.asp?id=34


发表您的评论