Private Const SHFMT_ID_DEFAULT = &HFFFF,标题:格式化磁盘" /> 格式化磁盘 - 关于VB的经验之谈 - VB爱好者乐园(VBGood) - 关于VB的经验,电子教程,代码,控件,论坛,博客,微博等.

VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 格式化磁盘
发表评论(0)作者:, 平台:, 阅读:13338, 日期:2000-03-12
格式化磁盘

在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