Formater un disque


Cet article montre comment formater un disque à partir d'une application Delphi.
procédure FormatDriveDialog
begin
& nbsp & nbsp ShellExecute(Application.Poignée,
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'Open',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'C:\Windows\Rundll32.exe',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'Shell32.dll,SHFormatDrive',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'C:\Windows',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp SW_SHOWNORMAL)
fin
fonction de SHFormatDrive(hWnd : HWnd
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp Lecteur, fmtID, Options : LongInt):longint
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp stdcall externe 'shell32.dll'
procédure QuietFormatDrive
const
& nbsp & nbsp SHFMT_ID_DEFAULT = $FFFF
& nbsp & nbsp SHFMT_OPT_QUICK = $0000
& nbsp & nbsp SHFMT_OPT_FULL = $0001
& nbsp & nbsp SHFMT_OPT_SYSONLY = $0002
& nbsp & nbsp SHFMT_ERROR = $FFFFFFFF
& nbsp & nbsp SHFMT_CANCEL = $FFFFFFFE
& nbsp & nbsp SHFMT_NOFORMAT = $FFFFFFFD
begin
& nbsp & nbsp cas SHFormatDrive(Handle, 0, SHFMT_ID_DEFAULT, SHFMT_OPT_FULL)
& ! & ! & ! & nbsp SHFMT_ERROR : ShowMessage('Erreur sur la dernière format, le lecteur peut être
formatable')
& ! & ! & ! & nbsp SHFMT_CANCEL : ShowMessage('le Dernier format a été annulé')
& ! & ! & ! & nbsp SHFMT_NOFORMAT : ShowMessage('le Lecteur n'est pas formatable')
& nbsp & nbsp fin
fin









Formater un disque


Formater un disque : Plusieurs milliers de conseils pour vous faciliter la vie.


Cet article montre comment formater un disque a partir d'une application Delphi.
procedure FormatDriveDialog
begin
& nbsp & nbsp ShellExecute(Application.Poignee,
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'Open',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'C:\Windows\Rundll32.exe',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'Shell32.dll,SHFormatDrive',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! 'C:\Windows',
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp SW_SHOWNORMAL)
fin
fonction de SHFormatDrive(hWnd : HWnd
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp Lecteur, fmtID, Options : LongInt):longint
& ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & nbsp stdcall externe 'shell32.dll'
procedure QuietFormatDrive
const
& nbsp & nbsp SHFMT_ID_DEFAULT = $FFFF
& nbsp & nbsp SHFMT_OPT_QUICK = $0000
& nbsp & nbsp SHFMT_OPT_FULL = $0001
& nbsp & nbsp SHFMT_OPT_SYSONLY = $0002
& nbsp & nbsp SHFMT_ERROR = $FFFFFFFF
& nbsp & nbsp SHFMT_CANCEL = $FFFFFFFE
& nbsp & nbsp SHFMT_NOFORMAT = $FFFFFFFD
begin
& nbsp & nbsp cas SHFormatDrive(Handle, 0, SHFMT_ID_DEFAULT, SHFMT_OPT_FULL)
& ! & ! & ! & nbsp SHFMT_ERROR : ShowMessage('Erreur sur la derniere format, le lecteur peut etre
formatable')
& ! & ! & ! & nbsp SHFMT_CANCEL : ShowMessage('le Dernier format a ete annule')
& ! & ! & ! & nbsp SHFMT_NOFORMAT : ShowMessage('le Lecteur n'est pas formatable')
& nbsp & nbsp fin
fin


Formater un disque

Formater un disque : Plusieurs milliers de conseils pour vous faciliter la vie.
Recommander aux amis
  • gplus
  • pinterest

Messages récents

Commentaire

Laisser un commentaire

évaluation