格式化磁盘演示

王朝厨房·作者佚名  2007-01-04
窄屏简体版  字體: |||超大  

Private Declare Function GetSystemDirectory Lib "kernel32" Alias _

"GetSystemDirectoryA" (ByVal lpBuffer As String, _

ByVal nSize As Long) As Long

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) 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

Const SW_SHOW = 5

Private Sub Command1_Click()

Dim sFor As String

Dim sTemp As String

sFor = String(260, " ")

GetWindowsDirectory sFor, 260

sTemp = Left$(sFor, InStr(sFor, Chr(0)) - 1) + "\rundll32.exe" _

+ Chr(0)

ShellExecute Me.hwnd, vbNullString, sTemp, _

"Shell32.dll,SHFormatDrive" + Chr(0), "c:\" + Chr(0), _

SW_SHOW

End Sub

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航