Grrrr
I'm using this:
But as you will see, if the desination directory (programs+'\Test\aa\')
does not exists, the file does not copy. Therefore, how can I create a
directory using Delphi?
procedure TForm1.Button3Click(Sender: TObject);
var
idl: PItemIDList;
Buffer: array[0..MAX_PATH-1] of Char;
Malloc: IMalloc;
desktop,programs : string;
begin
SHGetSpecialFolderLocation(Application.Handle, CSIDL_DESKTOP, idl);
SHGetPathFromIDList(idl, Buffer);
SHGetMalloc(Malloc);
Malloc.Free(idl);
desktop := Buffer;
SHGetSpecialFolderLocation(Application.Handle, CSIDL_PROGRAMS, idl);
SHGetPathFromIDList(idl, Buffer);
SHGetMalloc(Malloc);
Malloc.Free(idl);
programmes := Buffer;
CopyFile(PChar(desktop+'\test123.gif'),
PChar(programs+'\Test\aa\test123.gif'),false);
end;