⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 100个vb编程实例,什么都有
💻 FRM
字号:
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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -