Graphical
شنبه 19 مرداد 1387, 08:31 صبح
function CreateFolder(Foldername: string; aLocation: integer) : boolean;
var pIdl: PItemIDList;
hPath: PChar;
begin
Result := False;
if SUCCEEDED(SHGetSpecialFolderLocation(0, aLocation, pidl)) then
begin
hPath := StrAlloc(max_path) ;
SHGetPathFromIDList(pIdl, hPath) ;
SetLastError(0) ;
CreateDirectory(PChar(hPath + '//' + Foldername), nil) ;
if (GetLastError() = 0) or(GetLastError() = ERROR_ALREADY_EXISTS) then
Result := true;
StrDispose(hPath) ;
end;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
CreateFolder('MyProgramgroup', CSIDL_PROGRAMS) ;
end;
سلام
بنده با کدهای بالا یک گروه برنامه به منوی استارت اضافه میکنم اما نمیتونم shortcut رو به یک گروه برنامه اضافه کنم
var pIdl: PItemIDList;
hPath: PChar;
begin
Result := False;
if SUCCEEDED(SHGetSpecialFolderLocation(0, aLocation, pidl)) then
begin
hPath := StrAlloc(max_path) ;
SHGetPathFromIDList(pIdl, hPath) ;
SetLastError(0) ;
CreateDirectory(PChar(hPath + '//' + Foldername), nil) ;
if (GetLastError() = 0) or(GetLastError() = ERROR_ALREADY_EXISTS) then
Result := true;
StrDispose(hPath) ;
end;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
CreateFolder('MyProgramgroup', CSIDL_PROGRAMS) ;
end;
سلام
بنده با کدهای بالا یک گروه برنامه به منوی استارت اضافه میکنم اما نمیتونم shortcut رو به یک گروه برنامه اضافه کنم