home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 2940
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4380
- LinkTopic = "Form1"
- ScaleHeight = 2940
- ScaleWidth = 4380
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Caption = "Formatear Unidad A"
- Height = 1095
- Left = 480
- TabIndex = 0
- Top = 960
- Width = 3255
- 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" (ByVal hwnd As Long, ByVal Drive As Long, ByVal fmtID As Long, ByVal options As Long) As Long
- Private Sub Command1_Click()
- Formatear "A"
- End Sub
- Public Function Formatear(Raiz As String, Optional VentanaMadre As Long) As Boolean
- Dim DriveNumber As Long
- DriveNumber = (Asc(Raiz) - 65) ' Cambiar la letra a n
- mero: A=0 y an
- logamente
- Formatear = SHFormatDrive(VentanaMadre, DriveNumber, vbNull, vbNull)
- 'Esta
- ltima l
- nea tambi
- n puede ser
- 'Formatear = SHFormatDrive(VentanaMadre, DriveNumber, 0&, 0&)
- End Function
-