格式化磁盘
在Drive的参数中 "A:" = 0,类推。
Private Const SHFMT_ID_DEFAULT = &HFFFF&
'Currently the only fmtID supported.
Private Declare Function SHFormatDrive Lib "shell32.dll" (ByVal hWnd As Long,
ByVal Drive As Long, fmtID As Long, Options As Long) As Long
Private Sub Command1_Click()
Dim lret As Long
lret = SHFormatDrive(Me.hWnd, 0, SHFMT_ID_DEFAULT, 0)
Select Case lret
Case -2
MsgBox "OK !"
Case -3
MsgBox "Cannot format a read only drive !"
End Select
End Sub
|