Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.03.27;
Скачать: CL | DM;

Вниз

Как определить путь к рабочему столу   Найти похожие ветки 

 
DeskTop   (2005-02-16 13:58) [0]

текущего пользователя?. ОСи указаны в заголовке. Спасибо


 
Чапаев ©   (2005-02-16 14:06) [1]

WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(;

   HWND hwndOwner,  
   int nFolder,  
   LPITEMIDLIST *ppidl
  );


Parameters

hwndOwner

Handle of the owner window that the client should specify if it displays a dialog box or message box.

nFolder

Value specifying the folder to retrieve the location of. This parameter can be one of the following values:

CSIDL_BITBUCKET Recycle bin ѕ file system directory containing file objects in the user"s recycle bin. The location of this directory is not in the registry; it is marked with the hidden and system attributes to prevent the user from moving or deleting it.
CSIDL_CONTROLS Control Panel ѕ virtual folder containing icons for the control panel applications.
CSIDL_DESKTOP Windows desktop ѕ virtual folder at the root of the name space.
CSIDL_DESKTOPDIRECTORY File system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself).
CSIDL_DRIVES My Computer ѕ virtual folder containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives.
CSIDL_FONTS Virtual folder containing fonts.
CSIDL_NETHOOD File system directory containing objects that appear in the network neighborhood.
CSIDL_NETWORK Network Neighborhood ѕ virtual folder representing the top level of the network hierarchy.
CSIDL_PERSONAL File system directory that serves as a common respository for documents.
CSIDL_PRINTERS Printers folder ѕ virtual folder containing installed printers.
CSIDL_PROGRAMS File system directory that contains the user"s program groups (which are also file system directories).
CSIDL_RECENT File system directory that contains the user"s most recently used documents.
CSIDL_SENDTO File system directory that contains Send To menu items.
CSIDL_STARTMENU File system directory containing Start menu items.
CSIDL_STARTUP File system directory that corresponds to the user"s Startup program group.
CSIDL_TEMPLATES File system directory that serves as a common repository for document templates.


ppidl

Address that receives a pointer to an item identifier list specifying the folder"s location relative to the root of the name space (the desktop).



Return Values

Returns NOERROR if successful or an OLE-defined error result otherwise.


 
Ермак ©   (2005-02-16 14:15) [2]

Все предопределенные пути доступны через переменные окружения:
%systemroot% - директория Windows
%programfiles%
%userprofile% - профиль пользователя в Documents and Settings в XP. На 9х к сожалению проверить не могу. Открой cmd или command и попробуй. Но дело в том, что папка Desktop, AppData, MainMenu, Documents могут быть перенаправлены куда угодно - через реестр либо через групповую политику домена. Поэтому уверенным быть нельзя.
Но копать, я думаю, надо в направлении переменных окружения. Они точно должны быть и для этих папок. Перепробовал %userdesktop% и т.п. - не работает. Надо включать фантазию либо хелп...
Второй способ - найти в реестре. Там это прописывается тоже. Или искать функции WInAPI - для ситсемной папки точно есть, а для остальных - не уверен...


 
DeskTop   (2005-02-16 14:18) [3]

Благодарю, за оба поста



Страницы: 1 вся ветка

Текущий архив: 2005.03.27;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.043 c
14-1109945890
Vlad Oshin
2005-03-04 17:18
2005.03.27
В предверии 8 марта. Нет ли у кого красивых поздравлялок?


1-1110788976
dm37
2005-03-14 11:29
2005.03.27
Как можно организовать подсветку синтаксиса


8-1102076318
Алексей
2004-12-03 15:18
2005.03.27
И снова WinampAPI.


14-1110455760
mmms
2005-03-10 14:56
2005.03.27
Холодильник молотит без остановки, есть ли спецы?


1-1110573795
seregka
2005-03-11 23:43
2005.03.27
Как правильно пользоваться TprogressBar и/или Tgauge