楼主,你好,我是delphi新手,看了你的几个贴子,你应该对文件操作方面比较熟悉,想请教你一个问题,希望你能解答一下谢谢。我在VISTA下新建了一个c:/abc.../这种目录,但我想通过SHFileOperation API复制这个目录里面的文件如c:/abc.../abc.txt到其它文件夹下,但总是执行失败,在XP,2003等系统上是完全正常的,就是VISTA系统下失败。请帮个忙看看是什么原因,或者有没有能替代的函数,谢谢。复制函数如下:function OperateFile(s, t: string; op: integer): boolean; //文件操作var shf: tshfileopstruct; fromp, top: array[0..1023] of char;begin result := false; ZeroMemory(@shf, sizeof(shf)); fillchar(fromp, sizeof(fromp), 0); fillchar(top, sizeof(top), 0); strpcopy(fromp, s); strpcopy(top, t); with shf do begin shf.Wnd := 0; case op of FO_CM_COPY: shf.wFunc := fo_copy; FO_CM_MOVE: shf.wFunc := fo_move; FO_CM_DELETE: shf.wFunc := fo_delete; FO_CM_RENAME: shf.wFunc := fo_rename; end; shf.pFrom := fromp; shf.pTo := top; shf.fFlags := FOF_SILENT or FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION; shf.fAnyOperationsAborted := False; shf.hNameMappings := nil; shf.lpszProgressTitle := nil; end; try result := shfileoperation(shf)= 0; except end;end;