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

📄 frmmain.frm

📁 改变硬盘图标,vb源程序 改变硬盘图标,vb源程序
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Hard drive icon"
   ClientHeight    =   3420
   ClientLeft      =   150
   ClientTop       =   435
   ClientWidth     =   7290
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3420
   ScaleWidth      =   7290
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdPrew 
      Caption         =   "Preview"
      Height          =   495
      Left            =   4680
      TabIndex        =   8
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton cmdBrow 
      Caption         =   "Browse"
      Height          =   255
      Left            =   3120
      TabIndex        =   7
      Top             =   1680
      Width           =   735
   End
   Begin MSComDlg.CommonDialog Brow 
      Left            =   2880
      Top             =   2760
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      FileName        =   "c:\my documents\*.ico"
      Filter          =   "Icon files|*.ico"
   End
   Begin VB.CommandButton cmdMain 
      Caption         =   "Change"
      Height          =   375
      Left            =   720
      TabIndex        =   6
      Top             =   2880
      Width           =   1815
   End
   Begin VB.TextBox txtHD 
      Height          =   285
      Left            =   120
      TabIndex        =   5
      Top             =   2400
      Width           =   2895
   End
   Begin VB.TextBox txtPath 
      Height          =   285
      Left            =   120
      TabIndex        =   4
      Top             =   1680
      Width           =   2895
   End
   Begin VB.TextBox txtName 
      Height          =   285
      Left            =   120
      TabIndex        =   3
      Top             =   690
      Width           =   2895
   End
   Begin VB.Image imgIco 
      Height          =   2535
      Left            =   3960
      Stretch         =   -1  'True
      Top             =   240
      Width           =   2775
   End
   Begin VB.Label Label1 
      Caption         =   "Write the location of the icon (with "".ico""), or use Browse"
      Height          =   435
      Index           =   2
      Left            =   120
      TabIndex        =   2
      Top             =   1200
      Width           =   3000
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Write the name of the drive (ex.: C:\)"
      Height          =   195
      Index           =   1
      Left            =   120
      TabIndex        =   1
      Top             =   2160
      Width           =   2580
   End
   Begin VB.Label Label1 
      Caption         =   "Write the name of the icon (without "".ico"", can be a new name)"
      Height          =   435
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   3135
   End
   Begin VB.Menu ab 
      Caption         =   "About"
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub ab_Click()
frmAbout.Show 1, Me
End Sub

Private Sub cmdBrow_Click()
Brow.ShowOpen
If Brow.FileName = "" Then Exit Sub
txtPath.Text = Brow.FileName
prewi
End Sub

Private Sub cmdMain_Click()
On Error GoTo ts
Dim auto As String
Dim nam As String
Dim path As String
Dim HD As String
nam = txtName.Text
path = txtPath.Text
HD = txtHD.Text
auto = "[autorun]" & vbCrLf & "icon=" & nam & ".ico"
FileCopy path, HD & nam & ".ico"
Open HD & "AUTORUN.INF" For Output As 1
Print #1, auto
Close 1
MsgBox "Sucessfully changed!", vbInformation
Exit Sub
ts:
MsgBox "Somthin' is wrong: " & Err.Description, vbCritical
End Sub

Private Sub cmdPrew_Click()
prewi
End Sub


Private Sub txtPath_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdPrew = True
End Sub

Sub prewi()
On Error GoTo er
If txtPath.Text = "" Then Exit Sub
imgIco.Picture = LoadPicture(txtPath.Text)
er:
Select Case Err.Number
    Case 75
        MsgBox "That's not a picture file!", vbCritical
    Case 53
        MsgBox "File doesn't exist!", vbCritical
End Select

End Sub

⌨️ 快捷键说明

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