Здравствуйте, Батончик, Вы писали:
Б>Здравствуйте, Thespian, Вы писали:
T>>Пишу что-то вроде инсталлятора. Застрял на шаге, в котором указывается папка установки иконок.
T>>Искал описание данной темы в интернете и на данном форуме — никак. Может и не так искал...
T>>Подозреваю что в разных весиях винды — по разному (в 98 всё хранится в одной папке, в НТ — в папке юзера и общей папке). Не очень хотелось бы писать руками перечисление всех подпапок. Может есть цивильный метод? Также как потом добавить туда новую папку?
Б>Б>HRESULT SHGetFolderPath( HWND hwndOwner,
Б> int nFolder,
Б> HANDLE hToken,
Б> DWORD dwFlags,
Б> LPTSTR pszPath
Б>);
Б>
Б>Takes the CSIDL of a folder and returns the pathname.
Б>Значения для CSIDL:
Б>CSIDL_COMMON_PROGRAMS (0x0017)
Б>The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs. Valid only for Windows NT systems.
Б>CSIDL_PROGRAMS (0x0002)
Б>The file system directory that contains the user's program groups (which are themselves file system directories). A typical path is C:\Documents and Settings\username\Start Menu\Programs.
Б>The following code fragment uses SHGetFolderPath to find or create a folder and then creates a file in it.
Б>Б>TCHAR szPath[MAX_PATH];
Б>if(SUCCEEDED(SHGetFolderPath(NULL,
Б> CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
Б> NULL,
Б> 0,
Б> szPath)))
Б>{
Б> PathAppend(szPath, TEXT("New Doc.txt"));
Б> HANDLE hFile = CreateFile(szPath, ...);
Б>}
Б>
Б>ЗЫ: Читайте МСДН, друзья !
Спасибо.