1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| uses ShellAPI, ShlObj, ActiveX;
function GetSpecialFolder(AFolder: Integer): string; var pIdL: PItemIDList; Path: array[0..Max_Path] of Char; Allocator: IMalloc; begin SHGetSpecialFolderLocation(0, aFolder, pIdL); SHGetPathFromIDList(pIDL, Path); if Succeeded(SHGetMalloc (Allocator)) then Allocator.Free (pIdL); Result := Path; end;
ShellExecute(Application.Handle, 'open', PChar(GetSpecialFolder(CSIDL_DESKTOPDIRECTORY) + '\wunschexe.exe'), nil, PChar(GetSpecialFolder(CSIDL_DESKTOPDIRECTORY)), SW_SHOW); |