磁盘格式化.frm

来自「Windows API函数,希望大伙有用哦」· FRM 代码 · 共 38 行

FRM
38
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1695
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   1695
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "格式化磁盘"
      Height          =   315
      Left            =   2550
      TabIndex        =   0
      Top             =   1020
      Width           =   1245
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function SHFormatDrive Lib "shell32.dll" (ByVal hWnd As Long, ByVal Drive As Long, fmtID As Long, Options As Long) As Long
' 按默认容量格式化
Const SHFD_CAPACITY_DEFAULT = 0
' 快速格式化
Const SHFD_FORMAT_QUICK = 0
' 完全格式化
Const SHFD_FORMAT_FULL = 1
Private Sub Command1_Click()
 SHFormatDrive Me.hWnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_FULL
End Sub

⌨️ 快捷键说明

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