Главная страница
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.024 c
1-1110630898
X-Disa
2005-03-12 15:34
2005.03.27
Динамически создать форму


1-1110777184
LEXX_55
2005-03-14 08:13
2005.03.27
Трей


1-1110465314
Zahar
2005-03-10 17:35
2005.03.27
Использование индекса в именах компонентов...


3-1109235317
Peter_cc
2005-02-24 11:55
2005.03.27
SQL>255 символов


4-1108201843
Goorus
2005-02-12 12:50
2005.03.27
Опять Hook DLL :)