M
malin
Unregistered / Unconfirmed
GUEST, unregistred user!
我现在想格式化硬盘的某一个区,但不需要出现windows的提示框,我用了SHFormatDrive函数,但出现了提示框,请问各位有什么高招?下面是我的源码:
var
Form1: TForm1;
implementation
{$R *.dfm}
function SHFormatDrive(Hwnd:HWND;Drive:Integer;Size:Uint;Action:Integer):Integer;
stdcall;external 'shell32.dll' name 'SHFormatDrive';
procedure TForm1.Button1Click(Sender: TObject);
begin
FormatDrive(7,0);
showmessage('ok');
end;
function TForm1.FormatDrive(Drive, Action: Integer): Integer;
begin
Result:=SHFormatDrive(Application.Handle,Drive,0,Action);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function SHFormatDrive(Hwnd:HWND;Drive:Integer;Size:Uint;Action:Integer):Integer;
stdcall;external 'shell32.dll' name 'SHFormatDrive';
procedure TForm1.Button1Click(Sender: TObject);
begin
FormatDrive(7,0);
showmessage('ok');
end;
function TForm1.FormatDrive(Drive, Action: Integer): Integer;
begin
Result:=SHFormatDrive(Application.Handle,Drive,0,Action);
end;