📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "隐藏、显示桌面"
ClientHeight = 2760
ClientLeft = 60
ClientTop = 345
ClientWidth = 4710
LinkTopic = "Form1"
ScaleHeight = 2760
ScaleWidth = 4710
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "退出"
Height = 600
Left = 1020
TabIndex = 2
Top = 1890
Width = 2760
End
Begin VB.CommandButton Command2
Caption = "显示桌面"
Height = 600
Left = 1020
TabIndex = 1
Top = 1095
Width = 2760
End
Begin VB.CommandButton Command1
Caption = "隐藏桌面"
Height = 615
Left = 1020
TabIndex = 0
Top = 285
Width = 2775
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const REG_BINARY As Long = 3
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegDeleteValue& Lib "advapi32.dll" Alias "RegDeleteValueA" _
(ByVal hKey As Long, ByVal lpValueName As String)
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
(ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" _
(ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, _
ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Sub Command1_Click()
Dim hKey As Long
Dim bArr(0 To 4) As Byte
RegCreateKey HKEY_CURRENT_USER, _
"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", hKey
bArr(0) = &H1
RegSetValueEx hKey, "nodesktop", 0, REG_BINARY, bArr(0), 4
RegCloseKey hKey
End Sub
Private Sub Command2_Click()
Dim hKey As Long
Dim bArr(0 To 4) As Byte
RegCreateKey HKEY_CURRENT_USER, _
"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", hKey
RegDeleteValue hKey, "nodesktop"
RegCloseKey hKey
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -