![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как програмно узнать местоположение папки ProgramFiles
Илья Бобров © (2005-09-18 13:51:00)Как програмно узнать местоположение папки ProgramFiles
MBo (2005-09-18 14:11:00) [1]To get those special folders you use the ShGetSpecialFolderLocation API
function together with ShGetPathFromIDList:
Uses Windows, SysUtils, ActiveX, ShellAPI;
Function GetShellFoldername( folderID: Integer ): String;
Var
pidl: PItemIDList;
buf : Array[0..MAX_PATH] Of Char;
Begin
Result := '';
If Succeeded( ShGetSpecialFolderLocation( GetActiveWindow, folderID,
pidl ))
Then Begin
If ShGetPathfromIDList( pidl, buf ) Then
Result := buf;
CoTaskMemFree(pidl);
End { If }
End; { GetShellFoldername }
The folderID is one of the CSIDL_* constants defined in unit ShellAPI. For
the desktop folder you use CSIDL_DESKTOP, for the program menu folder
CSIDL_PROGRAMS.
Peter Below