📄 mainform.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form MainForm
BorderStyle = 0 'None
Caption = "太原十二中 苏洋"
ClientHeight = 7830
ClientLeft = -66510
ClientTop = 2010
ClientWidth = 9120
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7830
ScaleWidth = 9120
ShowInTaskbar = 0 'False
Begin VB.PictureBox btnMin
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 255
Left = 7440
ScaleHeight = 255
ScaleWidth = 375
TabIndex = 18
Top = 30
Width = 375
End
Begin VB.PictureBox btnMax
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 255
Left = 7840
ScaleHeight = 255
ScaleWidth = 405
TabIndex = 17
Top = 30
Width = 400
End
Begin VB.PictureBox btnEnd
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 255
Left = 8230
ScaleHeight = 255
ScaleWidth = 375
TabIndex = 16
Top = 30
Width = 375
End
Begin VB.PictureBox Btn6
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 7200
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 9
Top = 550
Width = 810
End
Begin VB.PictureBox Btn5
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 5880
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 8
Top = 550
Width = 810
End
Begin VB.PictureBox Btn4
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 4560
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 7
Top = 550
Width = 810
End
Begin VB.PictureBox Btn3
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 3240
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 6
Top = 550
Width = 810
End
Begin VB.PictureBox Btn2
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 1920
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 5
Top = 550
Width = 810
End
Begin VB.PictureBox Btn1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 810
Left = 600
ScaleHeight = 810
ScaleWidth = 810
TabIndex = 4
Top = 550
Width = 810
End
Begin VB.Timer NeiCun
Interval = 10
Left = 8280
Top = 7320
End
Begin VB.DriveListBox DriveList
Height = 300
Left = 600
TabIndex = 2
Top = 74400
Width = 735
End
Begin MSComctlLib.ListView MyDriverList
Height = 5895
Left = 220
TabIndex = 0
Top = 1450
Width = 8640
_ExtentX = 15240
_ExtentY = 10398
LabelWrap = -1 'True
HideSelection = -1 'True
HideColumnHeaders= -1 'True
OLEDragMode = 1
OLEDropMode = 1
GridLines = -1 'True
TextBackground = -1 'True
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ColHdrIcons = "ImageList1"
ForeColor = 0
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
OLEDragMode = 1
OLEDropMode = 1
NumItems = 0
End
Begin MSComctlLib.ImageList ImageList1
Left = 7680
Top = 7200
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 128
ImageHeight = 128
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 8
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":C85A
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":190B4
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":2590E
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":32168
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":3E9C2
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":4B21C
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainForm.frx":57A76
Key = ""
EndProperty
EndProperty
End
Begin VB.Label Say
BackStyle = 0 'Transparent
Caption = "USB卸载助手 - 让USB设备卸载从此简单..."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 170
TabIndex = 19
Top = 170
Width = 4575
End
Begin VB.Label LblReLoad
BackStyle = 0 'Transparent
Caption = "重新检测"
Height = 855
Left = 1560
TabIndex = 15
Top = 615
Width = 255
End
Begin VB.Label LblCheck
BackStyle = 0 'Transparent
Caption = "安全检测"
Height = 855
Left = 5520
TabIndex = 14
Top = 615
Width = 255
End
Begin VB.Label LblUpdate
BackStyle = 0 'Transparent
Caption = "软件升级"
Height = 855
Left = 6840
TabIndex = 13
Top = 615
Width = 255
End
Begin VB.Label LblOption
BackStyle = 0 'Transparent
Caption = "软件设置"
Height = 855
Left = 8160
TabIndex = 12
Top = 615
Width = 255
End
Begin VB.Label LblFUnload
BackStyle = 0 'Transparent
Caption = "强力卸载"
Height = 855
Left = 4200
TabIndex = 11
Top = 615
Width = 255
End
Begin VB.Label LblUnload
BackStyle = 0 'Transparent
Caption = "安全卸载"
Height = 855
Left = 2880
TabIndex = 10
Top = 615
Width = 255
End
Begin VB.Label LblTip
BackStyle = 0 'Transparent
Caption = "请先选择一个要执行操作的磁盘"
Height = 255
Left = 240
TabIndex = 1
Top = 7560
Width = 5175
End
Begin VB.Label Title
BackStyle = 0 'Transparent
Height = 525
Left = 0
TabIndex = 3
Top = 0
Width = 9135
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'将鼠标捕获权指派给某个家伙...前提:有句柄,所以实现按钮的变化就得用PictureBox而不能用ImageBox,所以白白浪费许多无辜的内存
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
'将鼠标捕获权收回...
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'/* 内存清理声明 */
Private Declare Function SetProcessWorkingSetSize Lib "kernel32" (ByVal hProcess As Long, ByVal dwMinimumWorkingSetSize As Long, ByVal dwMaximumWorkingSetSize As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
'/* 窗口位置声明 */
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
'/* 透明度声明 */
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'常数声明
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1
'无标题移动-常数声明
Const HTCAPTION = 2
Const WM_NCLBUTTONDOWN = &HA1
'自定义变量声明
Dim rtn As Long '定义变量获得窗口样式值
Dim key As String '定义字符串变量
Dim ChooseDriver As String '定义一个字串来放选中项目
Dim StrPath As String '设置路径变量
Dim blnIsUsb As Boolean '用来判断是不是USB设备
Private Sub MyDriverList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
ViewGreate.Visible = True
PopupMenu menus
End If
End Sub
Private Sub Command1_Click()
MyDriverList.View = lvwIcon
End Sub
Private Sub Command2_Click()
MyDriverList.View = lvwSmallIcon
End Sub
Private Sub Command3_Click()
MyDriverList.View = lvwList
End Sub
Private Sub Form_Load()
On Error Resume Next
Me.Picture = LoadResPicture("MainBoard", 0)
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
'* 窗体的透明处理*
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE) '取的窗口原先的样式
rtn = rtn Or WS_EX_LAYERED '使窗体添加上新的样式WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, rtn '把新的样式赋给窗体
'窗体中的透明色
SetLayeredWindowAttributes Me.hwnd, RGB(255, 0, 255), 0, LWA_COLORKEY '表明不显示窗体中的透明色
'而第二个参数表示透明色
'可以用RGB函数来指定颜色值
'窗体透明度
'SetLayeredWindowAttributes Me.hwnd, 0, 240, LWA_ALPHA '把窗体设置成半透明样式
'第二个参数表示透明程度
'取值范围 0 - 255.为0时就是一个全透明的窗体了
'初始化list
MyDriverList.SmallIcons = ImageList1
'检测磁盘
Call ReLoadList
btnMin.Picture = LoadResPicture("btnmin1", 0)
btnMax.Picture = LoadResPicture("btnmax1", 0)
btnEnd.Picture = LoadResPicture("btnend1", 0)
End Sub
Sub ReLoadList()
Btn1.Picture = LoadResPicture(103, 0)
Btn2.Picture = LoadResPicture(103, 0)
Btn3.Picture = LoadResPicture(103, 0)
Btn4.Picture = LoadResPicture(103, 0)
Btn5.Picture = LoadResPicture(103, 0)
Btn6.Picture = LoadResPicture(103, 0)
MyDriverList.ListItems.Clear
'* ICO列表 *
'1.为光驱 2.为软驱
'3.为 RAM 4.为可移动磁盘
'5.为硬盘 6.未知
'7.连接上的网络驱动器
'8.未连接的网络驱动器
'设置一个磁盘ID变量
Dim i As Long
'遍历磁盘
For i = 0 To DriveList.ListCount
'判断磁盘存在
If Len(DriveList.List(i)) <> 0 Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -