📄 config.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Caption = "SuperScreenSaver设置"
ClientHeight = 4890
ClientLeft = 3960
ClientTop = 960
ClientWidth = 7020
Icon = "Config.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form4"
MaxButton = 0 'False
ScaleHeight = 4890
ScaleWidth = 7020
Begin VB.TextBox TitleText
Height = 315
Left = 930
MaxLength = 30
TabIndex = 0
Top = 240
Width = 4725
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 285
Left = 720
MaxLength = 5
TabIndex = 22
Text = "2000"
Top = 4080
Width = 525
End
Begin VB.CheckBox Check1
Caption = "每"
Height = 285
Left = 180
TabIndex = 20
Top = 4080
Width = 495
End
Begin VB.OptionButton Option3
Caption = "黑色"
Height = 255
Index = 1
Left = 2880
TabIndex = 19
Top = 3390
Width = 765
End
Begin VB.OptionButton Option3
Caption = "默认"
Height = 255
Index = 0
Left = 2880
TabIndex = 18
Top = 3030
Value = -1 'True
Width = 765
End
Begin VB.Frame Frame2
Caption = "颜色 "
Height = 1365
Left = 150
TabIndex = 13
Top = 2520
Width = 5505
Begin VB.OptionButton Option2
Caption = "黑色"
Height = 255
Index = 1
Left = 210
TabIndex = 16
Top = 870
Value = -1 'True
Width = 765
End
Begin VB.OptionButton Option2
Caption = "Flash 背景色"
Height = 315
Index = 0
Left = 210
TabIndex = 15
Top = 510
Width = 1455
End
Begin VB.Label Label5
Caption = "Flash背景色"
Height = 225
Left = 2370
TabIndex = 17
Top = 240
Width = 1305
End
Begin VB.Label Label4
Caption = "窗体颜色"
Height = 165
Left = 210
TabIndex = 14
Top = 270
Width = 795
End
End
Begin VB.CommandButton Command1
Caption = "关于"
Height = 405
Index = 2
Left = 5850
TabIndex = 12
Top = 3420
Width = 1005
End
Begin VB.CommandButton Command1
Caption = "取消"
Height = 405
Index = 1
Left = 5850
TabIndex = 11
Top = 2820
Width = 1005
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 405
Index = 0
Left = 5850
TabIndex = 10
Top = 2250
Width = 1005
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 270
Index = 1
Left = 3150
MaxLength = 4
TabIndex = 8
Text = "400"
Top = 1440
Width = 465
End
Begin VB.Frame Frame1
Caption = "缩放"
Height = 1635
Left = 120
TabIndex = 1
Top = 690
Width = 5535
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 270
Index = 0
Left = 1680
MaxLength = 4
TabIndex = 6
Text = "300"
Top = 750
Width = 465
End
Begin VB.OptionButton Option1
Caption = "原来大小"
Height = 285
Index = 0
Left = 240
TabIndex = 4
Top = 360
Value = -1 'True
Width = 1155
End
Begin VB.OptionButton Option1
Caption = "自定义"
Height = 285
Index = 1
Left = 240
TabIndex = 3
Top = 750
Width = 945
End
Begin VB.OptionButton Option1
Caption = "全屏幕"
Height = 285
Index = 2
Left = 240
TabIndex = 2
Top = 1170
Width = 975
End
Begin VB.Label Label3
Caption = "Pix"
Height = 165
Left = 3570
TabIndex = 9
Top = 780
Width = 345
End
Begin VB.Label Label2
Caption = "Pix 宽"
Height = 225
Left = 2220
TabIndex = 7
Top = 780
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "高"
Height = 180
Left = 1410
TabIndex = 5
Top = 780
Width = 180
End
End
Begin VB.Label Label7
Caption = "标题:"
Height = 195
Left = 210
TabIndex = 23
Top = 300
Width = 585
End
Begin VB.Label Label6
Caption = "ms自动检测Flash是否正在播放,如果停止,则播放它"
Height = 225
Left = 1320
TabIndex = 21
ToolTipText = "由于有些Flash用了Action,使动画自动停止,你可预设置多久检测一次,默认为2秒"
Top = 4110
Width = 4635
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'=====================================
'设置窗口
'=====================================
Dim strIniFile As String
Sub init()
Dim mScale As String
Dim mHeight As String
Dim mWidth As String
Dim fColor As String
Dim mColor As String
Dim TimerEnable As String
Dim Interval As String
Dim fTitle As String
mScale = myReadINI(strIniFile, "SuperScreenSaver Config", "mScale", "Defult")
mHeight = myReadINI(strIniFile, "SuperScreenSaver Config", "mHeight", "300")
mWidth = myReadINI(strIniFile, "SuperScreenSaver Config", "mWidth", "400")
fColor = myReadINI(strIniFile, "SuperScreenSaver Config", "fColor", "Defult")
mColor = myReadINI(strIniFile, "SuperScreenSaver Config", "mColor", "Defult")
Interval = myReadINI(strIniFile, "SuperScreenSaver Config", "Interval", "Defult")
fTitle = myReadINI(strIniFile, "SuperScreenSaver Config", "TitleText", "")
'===============================
'初始化缩放
'================================
Select Case mScale
Case "DEFULT"
Option1(0).Value = True
Case "USERDEFULT"
Option1(1).Value = True
Case "FULLSCREEN"
Option1(2).Value = True
End Select
If IsNumeric(mHeight) Then Text1(0).Text = mHeight
If IsNumeric(mWidth) Then Text1(1).Text = mWidth
'================================
'初始化颜色
'================================
If fColor = "DEFULT" Then
Option2(1).Value = True
Else
Option2(0).Value = True
End If
If mColor = "DEFULT" Then
Option3(0).Value = True
Else
Option3(1).Value = True
End If
'================================
'初始化检测时间
'================================
If Interval <> "DEFULT" Then
Text2.Text = Interval
Text2.Enabled = True
Check1.Value = 1
End If
'================================
'初始化标题
'================================
TitleText.Text = fTitle
End Sub
Sub WriteConfig()
'写放配置信息
myWriteINI strIniFile, "SuperScreenSaver Config", "TitleText", TitleText.Text
If Option1(0).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "mScale", "Defult"
If Option1(1).Value = True Then
myWriteINI strIniFile, "SuperScreenSaver Config", "mScale", "UserDefult"
myWriteINI strIniFile, "SuperScreenSaver Config", "mHeight", Text1(0).Text
myWriteINI strIniFile, "SuperScreenSaver Config", "mWidth", Text1(1).Text
End If
If Option1(2).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "mScale", "FullScreen"
If Option2(0).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "fColor", "Flash"
If Option2(1).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "fColor", "Defult"
If Option3(0).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "mColor", "Defult"
If Option3(1).Value = True Then myWriteINI strIniFile, "SuperScreenSaver Config", "mColor", "Black"
If Check1.Value = 0 Then myWriteINI strIniFile, "SuperScreenSaver Config", "Interval", "2000"
If Check1.Value = 1 Then myWriteINI strIniFile, "SuperScreenSaver Config", "Interval", Text2.Text
End Sub
Private Sub Form_Load()
strIniFile = App.Path & IIf(Len(App.Path) < 4, App.EXEName & ".ini", "\" & App.EXEName & ".ini")
Call init
End Sub
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text2.Enabled = True
Else
Text2.Enabled = False
End If
End Sub
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0 '保存并退出
Call WriteConfig
End
Case 1 '不保存退出
End
Case 2
Form2.Show '显示关于
End Select
End Sub
Private Sub Option1_Click(Index As Integer)
Text1(0).Enabled = False
Text1(1).Enabled = False
If Index = 1 Then
Text1(1).Enabled = True
Text1(0).Enabled = True
End If
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
'限制只能输入数字
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If KeyAscii <> 8 Then KeyAscii = 0 '???
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If KeyAscii <> 8 Then KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -