Windows API函数,希望大伙有用哦

源代码在线查看: 显示和隐藏任务栏.frm

软件大小: 2032 K
上传用户: liangshuo800
关键词: Windows API 函数
下载地址: 免注册下载 普通下载 VIP

相关代码

				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
				
				
				
							

相关资源