L
luyear
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是Fyx的帖子!!!!!!!!!!!我还想知道的详细些!!!!!<br>来自:Fyx, 时间:00-11-18 9:11:00, ID:397396 <br>以下代码可以把C盘下的文件夹a复制成文件夹b:<br>uses ..., ShellAPI<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> OpStruc: TSHFileOpStruct;<br> frombuf, tobuf: Array [0..128] of Char;<br>Begin<br> FillChar( frombuf, Sizeof(frombuf), 0 );<br> FillChar( tobuf, Sizeof(tobuf), 0 );<br> StrPCopy( frombuf, 'c:/a' );<br> StrPCopy( tobuf, 'c:/b' );<br> With OpStruc DO Begin<br> Wnd:= Handle;<br> wFunc:= FO_COPY;<br> pFrom:= @frombuf;<br> pTo:=@tobuf;<br> fFlags:= FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;<br> fAnyOperationsAborted:= False;<br> hNameMappings:= Nil;<br> lpszProgressTitle:= Nil;<br> end;<br> ShFileOperation( OpStruc );<br>end;<br> <br>