how to programmatically format a floppy disk in visual studio.net
-----Message d'origine----- on dos prompt hit : Format c: q
"Chental" a écrit dans le
message de news:
244a201c45f4e$686b3240$
How to fomat a floppy disk, an idea ?
.
ng
Salut,
Par l'API Windows :
Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
Exemple en VB6 que l'on peut facilement adapter :
Const SHFD_CAPACITY_DEFAULT = 0 ' default drive capacity Const SHFD_CAPACITY_360 = 3 ' 360KB, applies to 5.25" drives only Const SHFD_CAPACITY_720 = 5 ' 720KB, applies to 3.5" drives only Const SHFD_FORMAT_QUICK = 0 ' quick format Const SHFD_FORMAT_FULL = 1 ' full format Const SHFD_FORMAT_SYSONLY = 2 ' copies system files only (Win95 Only!) Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long Private Sub Form_Load() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: 'iDrive = The drive number to format. Drive A=0, B=1 (if present, otherwise C=1), and so on. SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK End Sub
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Chental a écrit :
how to programmatically format a floppy disk in visual studio.net
-----Message d'origine----- on dos prompt hit : Format c: q
"Chental" a écrit dans le message de news: 244a201c45f4e$686b3240$
How to fomat a floppy disk, an idea ?
.
Salut,
Par l'API Windows :
Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal
iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
Exemple en VB6 que l'on peut facilement adapter :
Const SHFD_CAPACITY_DEFAULT = 0 ' default drive capacity
Const SHFD_CAPACITY_360 = 3 ' 360KB, applies to 5.25" drives only
Const SHFD_CAPACITY_720 = 5 ' 720KB, applies to 3.5" drives only
Const SHFD_FORMAT_QUICK = 0 ' quick format
Const SHFD_FORMAT_FULL = 1 ' full format
Const SHFD_FORMAT_SYSONLY = 2 ' copies system files only (Win95 Only!)
Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As
Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As
Long) As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'iDrive = The drive number to format. Drive A=0, B=1 (if present,
otherwise C=1), and so on.
SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK
End Sub
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Chental <anonymous@discussions.microsoft.com> a écrit :
how to programmatically format a floppy disk in visual
studio.net
-----Message d'origine-----
on dos prompt hit :
Format c: q
"Chental" <serinfo@sernamsudouest.com> a écrit dans le message de
news: 244a201c45f4e$686b3240$a501280a@phx.gbl...
Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
Exemple en VB6 que l'on peut facilement adapter :
Const SHFD_CAPACITY_DEFAULT = 0 ' default drive capacity Const SHFD_CAPACITY_360 = 3 ' 360KB, applies to 5.25" drives only Const SHFD_CAPACITY_720 = 5 ' 720KB, applies to 3.5" drives only Const SHFD_FORMAT_QUICK = 0 ' quick format Const SHFD_FORMAT_FULL = 1 ' full format Const SHFD_FORMAT_SYSONLY = 2 ' copies system files only (Win95 Only!) Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long Private Sub Form_Load() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: 'iDrive = The drive number to format. Drive A=0, B=1 (if present, otherwise C=1), and so on. SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK End Sub
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Chental a écrit :
how to programmatically format a floppy disk in visual studio.net
-----Message d'origine----- on dos prompt hit : Format c: q
"Chental" a écrit dans le message de news: 244a201c45f4e$686b3240$