📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
BorderStyle = 4 'Fixed ToolWindow
Caption = "设置"
ClientHeight = 3720
ClientLeft = 45
ClientTop = 345
ClientWidth = 4125
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3720
ScaleWidth = 4125
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CheckBox Check2
Caption = "开机启动"
Height = 255
Left = 120
TabIndex = 6
Top = 3240
Width = 2055
End
Begin VB.ListBox List1
Appearance = 0 'Flat
Height = 1590
Left = 120
TabIndex = 3
Top = 1080
Width = 3855
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 375
Left = 2880
TabIndex = 1
Top = 3120
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "监视硬盘[可选范围]"
Height = 255
Left = 120
TabIndex = 0
Top = 360
Value = 1 'Checked
Width = 3735
End
Begin VB.Line Line2
X1 = 0
X2 = 4200
Y1 = 2880
Y2 = 2880
End
Begin VB.Line Line1
X1 = 0
X2 = 4200
Y1 = 720
Y2 = 720
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "监控时间"
Height = 255
Left = 120
TabIndex = 5
Top = 3000
Width = 3855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "文件监控[重起-本软件 生效] -双击更改"
Height = 255
Left = 120
TabIndex = 4
Top = 840
Width = 3855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "程序启动监视范围 -默认移动存储器[不可关闭]"
Height = 495
Left = 120
TabIndex = 2
Top = 120
Width = 4575
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check2_Click()
If Check2.value = 1 Then
If RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", 0, KEY_ALL_ACCESS, phkResult) <> ERROR_SUCCESS Then
Call RegCloseKey(phkResult)
End If
RegSetStringValue phkResult, "Gwf", App.path & "\GwfLoader.exe -Start"
Else
DeleteValue HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "Gwf", 1
End If
End Sub
Private Sub Command1_Click()
SaveSetting
Me.Hide
MsgBox "请重新启动本程序", 64
End
End Sub
Public Function SaveSetting()
WriteIni "设置", "硬盘", Check1.value, App.path & "\Setting.ini"
'For i = 1 To 6
i = 1
tmp1 = List1.List(i - 1)
ii = InStr(tmp1, "-")
If ii <> 0 Then
tmp2 = right(tmp1, Len(tmp1) - ii):
If tmp2 = "监控开启" Then tmp3 = 1 Else tmp3 = 0
WriteIni "设置", "文件监控1", tmp3, App.path & "\Setting.ini"
End If
'Next i
WriteIni "设置", "启动", Check2.value, App.path & "\Setting.ini"
End Function
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub List1_DblClick()
tmp1 = List1.List(List1.ListIndex)
ii = InStr(tmp1, "-")
If ii <> 0 Then
tmp2 = right(tmp1, Len(tmp1) - ii):
tmp4 = left(tmp1, ii)
If tmp2 = "监控开启" Then tmp3 = "监控关闭" Else tmp3 = "监控开启":
List1.List(List1.ListIndex) = tmp4 & tmp3
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -