让我发疯的问题(50分)

  • 主题发起人 主题发起人 lgsonline
  • 开始时间 开始时间
procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; FromBuf, ToBuf : PChar;<br>&nbsp; FromLen, ToLen : integer;<br>&nbsp; sfo : SHFileOpStruct;<br>begin<br>&nbsp; FromLen := Length(Edit1.Text);<br>&nbsp; GetMem(FromBuf, FromLen+2);<br>&nbsp; FillChar(FromBuf^, FromLen+2, 0);<br>&nbsp; StrPCopy(FromBuf, Edit1.Text);<br>&nbsp; ToLen := Length(Edit2.Text);<br>&nbsp; GetMem(ToBuf, ToLen+2);<br>&nbsp; FillChar(ToBuf^, ToLen+2, 0);<br>&nbsp; StrPCopy(ToBuf, Edit2.Text);<br>&nbsp; FillChar(sfo, sizeof(sfo), 0);<br>&nbsp; with sfo do begin<br>&nbsp; &nbsp; Wnd := Handle;<br>&nbsp; &nbsp; wFunc := FO_COPY;<br>&nbsp; &nbsp; pFrom := FromBuf;<br>&nbsp; &nbsp; pTo := ToBuf;<br>&nbsp; &nbsp; fFlags := 0;<br>&nbsp; end;<br>&nbsp; SHFileOperation(sfo);<br>&nbsp; FreeMem(FromBuf);<br>&nbsp; FreeMem(ToBuf);<br>end;<br>
 
非常感谢大家的帮忙,我认为月满西楼的解答是最好的<br>我给月满西楼30分,给pnljh20分,我第一次来这里不知道这里的<br>规矩,分如果给的有问题,请原谅,谢谢大家的帮忙
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
809
import
I
后退
顶部