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

📄 frmsettings.frm

📁 vb网络变成
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   End
   Begin VB.Image Image5 
      Height          =   315
      Left            =   1560
      Picture         =   "FrmSettings.frx":1D651
      Top             =   4560
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.Image Image7 
      Height          =   330
      Left            =   120
      Picture         =   "FrmSettings.frx":1DB46
      Top             =   4920
      Visible         =   0   'False
      Width           =   1425
   End
   Begin VB.Image Image8 
      Height          =   315
      Left            =   1560
      Picture         =   "FrmSettings.frx":1E255
      Top             =   4920
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.Image Image19 
      Height          =   330
      Left            =   3600
      Picture         =   "FrmSettings.frx":1E777
      ToolTipText     =   "Settings"
      Top             =   3850
      Width           =   1425
   End
   Begin VB.Image Image20 
      Height          =   330
      Left            =   5640
      Picture         =   "FrmSettings.frx":1EE86
      ToolTipText     =   "Settings"
      Top             =   3600
      Width           =   1425
   End
   Begin VB.Image Image21 
      Height          =   330
      Left            =   5640
      Picture         =   "FrmSettings.frx":1F595
      ToolTipText     =   "Settings"
      Top             =   3960
      Width           =   1425
   End
   Begin VB.Shape Shape3 
      Height          =   3615
      Left            =   120
      Shape           =   4  'Rounded Rectangle
      Top             =   720
      Width           =   3135
   End
   Begin VB.Shape Shape1 
      Height          =   2415
      Left            =   3480
      Shape           =   4  'Rounded Rectangle
      Top             =   720
      Width           =   3735
   End
   Begin VB.Shape Shape2 
      Height          =   615
      Left            =   3480
      Shape           =   4  'Rounded Rectangle
      Top             =   3720
      Width           =   1695
   End
End
Attribute VB_Name = "FrmSettings"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey 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 RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long


Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long


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 RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData 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
    Const ERROR_SUCCESS = 0&
    Const REG_SZ = 1 ' Unicode nul terminated String
    Const REG_DWORD = 4 ' 32-bit number


Public Enum HKeyTypes
    HKEY_CLASSES_ROOT = &H80000000
    HKEY_CURRENT_USER = &H80000001
    HKEY_LOCAL_MACHINE = &H80000002
    HKEY_USERS = &H80000003
    HKEY_PERFORMANCE_DATA = &H80000004
End Enum

'For Dragging Borderless Forms...
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SetWindowRgn Lib "User32" (ByVal hwnd As Long, ByVal hrgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function ReleaseCapture Lib "User32" () As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

Dim sControlSelected As String

Private Sub Form_Load()
Dim CheckMe1 As String
Dim CheckMe2 As String
Dim CheckMe3 As String
Dim CheckMe4 As String
Dim AutoApply As String

CheckMe1 = ReadINI("settings", "launchatstartup", App.Path & "\settings.ini")
CheckMe2 = ReadINI("settings", "showdesktopform", App.Path & "\settings.ini")
CheckMe3 = ReadINI("settings", "showmainform", App.Path & "\settings.ini")
CheckMe4 = ReadINI("settings", "mainontop", App.Path & "\settings.ini")
AutoApply = ReadINI("settings", "autoapply", App.Path & "\settings.ini")
IconToUse = ReadINI("settings", "icon", App.Path & "\settings.ini")

If CheckMe1 = "unchecked" Then
Image3.Picture = Image1.Picture
End If
If CheckMe1 = "checked" Then
Image3.Picture = Image2.Picture
End If

If CheckMe2 = "unchecked" Then
Image11.Picture = Image1.Picture
End If
If CheckMe2 = "checked" Then
Image11.Picture = Image2.Picture
End If

If CheckMe3 = "unchecked" Then
Image10.Picture = Image1.Picture
End If
If CheckMe3 = "checked" Then
Image10.Picture = Image2.Picture
End If

If CheckMe4 = "unchecked" Then
Image22.Picture = Image1.Picture
End If
If CheckMe4 = "checked" Then
Image22.Picture = Image2.Picture
End If

If AutoApply = "unchecked" Then
Image23.Picture = Image1.Picture
End If
If AutoApply = "checked" Then
Image23.Picture = Image2.Picture
End If

If IconToUse = "icon1" Then
sControlSelected = "icon1"
imgSelected_Click (0)
End If

If IconToUse = "icon2" Then
sControlSelected = "icon2"
imgSelected_Click (1)
End If

If IconToUse = "icon3" Then
sControlSelected = "icon3"
imgSelected_Click (2)
End If

If IconToUse = "icon4" Then
sControlSelected = "icon4"
imgSelected_Click (3)
End If

If IconToUse = "icon5" Then
sControlSelected = "icon5"
imgSelected_Click (4)
End If
Me.Height = 4485
Me.Width = 7500
End Sub

Private Sub Image10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    If Image10.Picture = Image1.Picture Then
    Image10.Picture = Image2.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    Exit Sub
    End If
    If Image10.Picture = Image2.Picture Then
    Image10.Picture = Image1.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    End If
End If
End Sub

Private Sub Image11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    If Image11.Picture = Image1.Picture Then
    Image11.Picture = Image2.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    Exit Sub
    End If
    If Image11.Picture = Image2.Picture Then
    Image11.Picture = Image1.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    End If
End If
End Sub

Private Sub Image22_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    If Image22.Picture = Image1.Picture Then
    Image22.Picture = Image2.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    Exit Sub
    End If
    If Image22.Picture = Image2.Picture Then
    Image22.Picture = Image1.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    End If
End If
End Sub

Private Sub Image23_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    If Image23.Picture = Image1.Picture Then
    Image23.Picture = Image2.Picture
    Exit Sub
    End If
    If Image23.Picture = Image2.Picture Then
    Image23.Picture = Image1.Picture
    End If
End If
End Sub

Private Sub Image3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    If Image3.Picture = Image1.Picture Then
    Image3.Picture = Image2.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    Exit Sub
    End If
    If Image3.Picture = Image2.Picture Then
    Image3.Picture = Image1.Picture
    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    End If
End If
End Sub

Private Sub imgClose_Click()
Unload Me
End Sub

Private Sub imgClose_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then
    imgClose.Picture = Image5.Picture
End If

End Sub
Private Sub imgClose_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then
    imgClose.Picture = Image8.Picture
End If

End Sub

Private Sub imgSelected_Click(Index As Integer)
Dim X As Byte

'Clear the radio buttons...
For X = 0 To 4
    imgSelected(X).Picture = Image6.Picture
Next X

'Update the radio buttons...
imgSelected(Index).Picture = Image9.Picture

'Remember the control selected...
Select Case Index
    Case 0
        sControlSelected = "icon1"
    Case 1
        sControlSelected = "icon2"
    Case 2
        sControlSelected = "icon3"
    Case 3
        sControlSelected = "icon4"
    Case 4
        sControlSelected = "icon5"
End Select


    If Image23.Picture = Image2.Picture Then
    Call Label5_Click
    End If
    
End Sub

Private Sub Label15_Click()
FrmColors.Show
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    Call DragForm(Me)
    DoEvents
End If
End Sub
Public Sub DragForm(Frm As Form)

On Local Error Resume Next

'Move the borderless form...
Call ReleaseCapture
Call SendMessage(Frm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)

End Sub

Private Sub Label5_Click()

If Image3.Picture = Image2.Picture Then
Call AddToRun("CS Bandwidth Monitor", App.Path & "\" & App.EXEName & ".exe")
End If
If Image3.Picture = Image1.Picture Then
Call RemoveFromRun("CS Bandwidth Monitor")
End If

Call SaveChanges
IconToUse = sControlSelected

End Sub

Private Sub Label5_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    Image20.Picture = Image4.Picture
End If
End Sub
Private Sub Label5_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then
    Image20.Picture = Image7.Picture
End If
End Sub

Private Sub Label7_Click()
Unload Me
End Sub

Private Sub Label7_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    Image21.Picture = Image4.Picture
End If
End Sub
Private Sub Label7_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then
    Image21.Picture = Image7.Picture
End If
End Sub
Private Sub Label15_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    Image19.Picture = Image4.Picture
End If
End Sub
Private Sub Label15_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then
    Image19.Picture = Image7.Picture
End If
End Sub
Sub SaveChanges()

'On Local Error Resume Next

'Save the color settings to the skin scheme ini file...
    If Image3.Picture = Image1.Picture Then
    Call WriteINI("settings", "launchatstartup", "unchecked", App.Path & "\settings.ini")
    End If
    If Image3.Picture = Image2.Picture Then
    Call WriteINI("settings", "launchatstartup", "checked", App.Path & "\settings.ini")
    End If
    
    If Image11.Picture = Image1.Picture Then
    Call WriteINI("settings", "showdesktopform", "unchecked", App.Path & "\settings.ini")
    End If
    If Image11.Picture = Image2.Picture Then
    Call WriteINI("settings", "showdesktopform", "checked", App.Path & "\settings.ini")
    End If

    If Image10.Picture = Image1.Picture Then
    Call WriteINI("settings", "showmainform", "unchecked", App.Path & "\settings.ini")
    End If
    If Image10.Picture = Image2.Picture Then
    Call WriteINI("settings", "showmainform", "checked", App.Path & "\settings.ini")
    End If
   
    If Image22.Picture = Image1.Picture Then
    Call WriteINI("settings", "mainontop", "unchecked", App.Path & "\settings.ini")
    MainOnTop = False
    End If
    If Image22.Picture = Image2.Picture Then
    Call WriteINI("settings", "mainontop", "checked", App.Path & "\settings.ini")
    MainOnTop = True
    End If

    If Image23.Picture = Image1.Picture Then
    Call WriteINI("settings", "autoapply", "unchecked", App.Path & "\settings.ini")
    End If
    If Image23.Picture = Image2.Picture Then
    Call WriteINI("settings", "autoapply", "checked", App.Path & "\settings.ini")
    End If
    
Call WriteINI("settings", "icon", sControlSelected, App.Path & "\settings.ini")

End Sub
Public Sub AddToRun(ProgramName As String, FileToRun As String)
    'Add a program to the 'Run at Startup' r
    '     egistry keys
    Call SaveString(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", ProgramName, FileToRun)
End Sub


Public Sub RemoveFromRun(ProgramName As String)
    'Remove a program from the 'Run at Start
    '     up' registry keys
    Call DeleteValue(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", ProgramName)
End Sub
Public Sub SaveString(hKey As HKeyTypes, strPath As String, strValue As String, strData As String)
    'EXAMPLE:
    '
    'Call savestring(HKEY_CURRENT_USER, "Sof
    '     tware\VBW\Registry", "String", text1.tex
    '     t)
    '
    Dim keyhand As Long
    Dim r As Long
    r = RegCreateKey(hKey, strPath, keyhand)
    r = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strData, Len(strData))
    r = RegCloseKey(keyhand)
End Sub


Public Function DeleteValue(ByVal hKey As HKeyTypes, ByVal strPath As String, ByVal strValue As String)
    'EXAMPLE:
    '
    'Call DeleteValue(HKEY_CURRENT_USER, "So
    '     ftware\VBW\Registry", "Dword")
    '
    Dim keyhand As Long
    r = RegOpenKey(hKey, strPath, keyhand)
    r = RegDeleteValue(keyhand, strValue)
    r = RegCloseKey(keyhand)
End Function


Public Function DeleteKey(ByVal hKey As HKeyTypes, ByVal strPath As String)
    'EXAMPLE:
    '
    'Call DeleteKey(HKEY_CURRENT_USER, "Soft
    '     ware\VBW\Registry")
    '
    Dim keyhand As Long
    r = RegDeleteKey(hKey, strPath)
End Function

⌨️ 快捷键说明

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