pFrom must be double null terminated since it can contain multiple file names, each seperated by a single null char:
SHFileStruct.pFrom := PChar(Folder + #0) ; // = 'c:\dmi\help'#0 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of David O'Brien > Sent: Monday, 15 October 2001 4:15 pm > To: Multiple recipients of list delphi > Subject: RE: [DUG]: Renaming Folders in Windows > > > SHFileoperation returns 31. Is there any example code out there? > > var > SHFileStruct: _SHFileOpStructA ; > > ... > SHFileStruct.Wnd := 0 ; > SHFileStruct.wFunc := FO_Rename ; > SHFileStruct.pFrom := PChar(Folder) ; // = 'c:\dmi\help' > SHFileStruct.pTo := PChar(NewFolder) ; // = 'c:\dmi\help1' > SHFileStruct.fFlags := FOF_SILENT ; > x := SHFileOperation(SHFileStruct) ; // Returns 31 > if x <> 0 then > ... > > Dave. > > -----Original Message----- > From: Patrick Dunford [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 15, 2001 3:47 PM > To: Multiple recipients of list delphi > Subject: RE: [DUG]: Renaming Folders in Windows > > > ShFileOperation > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > > Behalf Of David O'Brien > > Sent: Monday, 15 October 2001 14:58 > > To: Multiple recipients of list delphi > > Subject: [DUG]: Renaming Folders in Windows > > > > > > Is there a simple function to do this? I can't find anything in > either the > > D5 or Win32 help. > > > > ------------------------------------------------------------------ > --------- > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > ------------------------------------------------------------------ > --------- > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/