显示和隐藏任务栏_工作界面操作_API函数应用_VB源码
显示和隐藏任务栏的VB源码
以下存为文件:显示和隐藏任务栏.frm VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1110
ClientLeft = 60
ClientTop = 345
ClientWidth = 4320
LinkTopic = "Form1"
ScaleHeight = 1110
ScaleWidth = 4320
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "显示任务栏"
Height = 405
Left = 2310
TabIndex = 1
Top = 270
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "隐藏任务栏"
Height = 405
Left = 630
TabIndex = 0
Top = 270
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
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
hWndInsterAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal
cy As Long, ByVal wFlags As Long) As Long
Dim hWndl As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Private Sub Form_Load()
hWndl = FindWindow("Shell_traywnd", "") End Sub
Private Sub Command1_Click()
SetWindowPos hWndl, 0, 0, 0, 0, 0, SWP_HIDEWINDOW End Sub
Private Sub Command2_Click()
SetWindowPos hWndl, 0, 0, 0, 0, 0, SWP_SHOWWINDOW End Sub
以下存为文件:显示和隐藏任务栏.vbp
Type=Exe
Form=显示和隐藏任务栏.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#D:\WINNT\system32\
stdole2.tlb#OLE Automation
IconForm="Form1"
Startup="Form1"
Command32=""
Name="工程1"
HelpContextID="0" CompatibleMode="0" MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0 ServerSupportFiles=0 CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0 MaxNumberOfThreads=1
[MS Transaction Server] AutoRefresh=1