
![]() |
Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
|
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[216.73.216.3] |
![]() |
|
![]() |
![]() |
|
![]() ![]() Option Explicit PrivateConst SHFMT_ID_DEFAULT = &HFFFF ' Option bits for options parameter PrivateConst SHFMT_OPT_FULL = 1 PrivateConst SHFMT_OPT_SYSONLY = 2 Private Declare Function SHFormatDrive Lib "shell32.dll" (ByVal hwnd As Long, ByVal Drive As Long, ByVal fmtID As Long, ByVal options As Long) As Long Private Declare Function GetDriveType Lib "kernel32.dll" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Private Sub FormatDisk(hWndOwner As Long, ByVal DriveLetter As String) Dim DriveNum As Long, DriveType As Long DriveLetter = Left(DriveLetter, 1) & ":\" DriveNum = Asc(UCase(DriveLetter)) - Asc("A") Call SHFormatDrive(hWndOwner, DriveNum, SHFMT_ID_DEFAULT, SHFMT_OPT_FULL) End Sub Private Sub Form_Load() Call FormatDisk(0, "C:\") End Sub |