إخواني:
هذه الدالة تمكنك من تهيئة القرص المرن:
عرف هذه الدالة كالتالي:
function FormatFloppyDrive(hWnd : HWND; Drive : Word; fmtID : Word; Options : Word) : Longint
stdcall; external 'Shell32.dll' name 'SHFormatDrive';
ثم ضع زر على الفورم وأضف هذا الإجراء:
procedure TForm1.Button1Click(Sender: TObject);
const Fmt_A = 0; // Pass this parameter to format drive A:
const Fmt_B = 1; // Pass this parameter to format drive B:
const ID_DEFAULT = $FFFF; //This must be the value of fmtID
const FULLFORMAT = 0; // Perform Full Format
const QUICKFORMAT = 1; //Perform Quick Format
var
Done : longint;
begin
Done:= FormatFloppyDrive(Handle, Fmt_A, ID_DEFAULT, FULLFORMAT);
ShowMessage('If you have a good example for formatting the'+
'drive directly without using this dialog box let me know');
end;
لمزيد من المعلومات راجع MSDN Library