隐藏Windows的开始按钮VB源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
VERSION 5.00
Begin VB.Form frmMain
Caption = "隐藏Windows的开始按钮"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.OptionButton Option1
Caption = "隐藏Windows开始按钮"
Height = 495
Index = 1
Left = 1268
TabIndex = 1
Top = 1650
Width = 2145
End
Begin VB.OptionButton Option1
Caption = "显示Windows开始按钮"
Height = 495
Index = 0
Left = 1268
TabIndex = 0
Top = 1050
Value = -1 'True
Width = 2145
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Sub Form_Unload(Cancel As Integer)
If Option1(1).Value Then Call Option1_Click(0)
End Sub
Private Sub Option1_Click(Index As Integer)
Dim hLong As Long
Dim hwnd As Long
hwnd = FindWindow("Shell_TrayWnd", vbNullString)
hLong = FindWindowEx(hwnd, 0, "Button", vbNullString)
Select Case Index
Case 0
ShowWindow hLong, SW_SHOW
Case 1
ShowWindow hLong, SW_HIDE
End Select
End Sub