核心提示:varS: string;T: TSHFileOpStruct; beginS := '目录名';with T dobeginWnd := 0;wFunc := FO_DELETE;pFrom :=...
var S: string;
T: TSHFileOpStruct;
begin
S := '目录名';
with T do
begin
Wnd := 0;
wFunc := FO_DELETE;
pFrom := PChar(S);
pTo := nil;
fFlags := FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_NOERRORUI;
//标志表明允许恢复,无须确认并不显示出错信息
hNameMappings := nil;
lpszProgressTitle := '正在删除文件夹';
fAnyOperationsAborted := False;
end;
SHFileOperation(T);
end;