procedure TForm1.Button1Click(Sender: TObject);<br>var<br>F:TShFileOpStruct;<br>begin<br>F.wnd:=Handle;<br>F.wFunc:=FO_COPY; {操作方式}<br>F.pFrom:='C:/DEMO'#0#0;<br>F.pTo:='C:/TEST'#0#0;<br>F.fFlags:=FOF_ALLOWUNDO OR FOF_RENAMEONCOLLISION; {操作选项}<br>if ShFileOperation(F)<>0 then<br>ShowMessage('文件拷贝失败!');<br>end;<br><br>end.