📄 注册表修改.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H8000000B&
Caption = "Form1"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 345
ClientWidth = 6510
LinkTopic = "Form1"
ScaleHeight = 3435
ScaleWidth = 6510
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "重新设置"
Height = 345
Left = 4080
TabIndex = 11
Top = 2820
Width = 975
End
Begin VB.CommandButton Command2
Caption = "返回系统"
Height = 345
Left = 5040
TabIndex = 2
Top = 2820
Width = 975
End
Begin VB.Frame Frame1
Appearance = 0 'Flat
BackColor = &H8000000B&
Caption = "修改选项"
ForeColor = &H80000008&
Height = 1425
Left = 360
TabIndex = 1
Top = 1170
Width = 5685
Begin VB.CheckBox Check4
Caption = "Check4"
Height = 225
Left = 3150
TabIndex = 10
Top = 840
Width = 225
End
Begin VB.CheckBox Check3
Caption = "Check3"
Height = 225
Left = 3150
TabIndex = 9
Top = 360
Width = 225
End
Begin VB.CheckBox Check2
Caption = "Check2"
Height = 225
Left = 270
TabIndex = 8
Top = 840
Width = 225
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 225
Left = 270
TabIndex = 7
Top = 360
Width = 225
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "允许使用显示选项"
Height = 180
Left = 3660
TabIndex = 6
Top = 870
Width = 1440
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "禁止使用显示选项"
Height = 180
Left = 3690
TabIndex = 5
Top = 420
Width = 1440
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "允许改变墙纸"
Height = 180
Left = 780
TabIndex = 4
Top = 870
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "禁止改变墙纸"
Height = 180
Left = 840
TabIndex = 3
Top = 420
Width = 1080
End
End
Begin VB.Image Image1
Height = 480
Left = 420
Picture = "注册表修改.frx":0000
Top = 180
Width = 480
End
Begin VB.Line Line1
BorderColor = &H80000005&
BorderWidth = 2
X1 = 0
X2 = 7050
Y1 = 960
Y2 = 960
End
Begin VB.Shape Shape1
BorderColor = &H80000001&
BorderWidth = 2
FillColor = &H00FF0000&
Height = 585
Left = 1890
Shape = 4 'Rounded Rectangle
Top = 150
Width = 2805
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "注 册 表 修 改"
BeginProperty Font
Name = "华文行楷"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1980
TabIndex = 0
Top = 240
Width = 2595
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 RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
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 lpSubKey As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As Any, ByVal cbData As Long) As Long
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) As Long
Const REG_SZ = 1
Const HKEY_CURRENT_USER = &H80000001
Dim hKeyHandle As Long
Private Sub Check1_Click()
Dim A1 As String
If Check1.Value = 1 Then
Check2.Enabled = False
A1 = "1"
RegCreateKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop", hKeyHandle
RegSetValueEx hKeyHandle, "NoChangingWallPaper", 0&, REG_SZ, A1, Len(A1)
End If
End Sub
Private Sub Check2_Click()
Dim A1 As String
If Check2.Value = 1 Then
Check1.Enabled = False
RegCreateKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop", hKeyHandle
RegDeleteValue hKeyHandle, "NoChangingWallPaper"
End If
End Sub
Private Sub Check3_Click()
Dim A1 As String
If Check3.Value = 1 Then
Check4.Enabled = False
A1 = "1"
RegCreateKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", hKeyHandle
RegSetValueEx hKeyHandle, "NoDispCPL", 0&, REG_SZ, A1, Len(A1)
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = 1 Then
Check3.Enabled = False
RegCreateKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System", hKeyHandle
RegDeleteValue hKeyHandle, "NoDispCPL"
End If
End Sub
Private Sub Command1_Click()
Check1.Value = 0: Check2.Value = 0
Check3.Value = 0: Check4.Value = 0
Check1.Enabled = True: Check2.Enabled = True
Check3.Enabled = True: Check4.Enabled = True
End Sub
Private Sub Command2_Click()
RegCloseKey HKEY_CURRENT_USER
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -