Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2005.03.27;
Скачать: [xml.tar.bz2];

Вниз

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

 
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 вся ветка

Форум: "WinAPI";
Текущий архив: 2005.03.27;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.073 c
3-1109583378
wolf2541
2005-02-28 12:36
2005.03.27
Не работает etoCanNavigation в dxDbTreeList


14-1109935545
boriskb
2005-03-04 14:25
2005.03.27
Молдавия


14-1110030699
Pat
2005-03-05 16:51
2005.03.27
Выбор микроволновки


1-1110818082
nes
2005-03-14 19:34
2005.03.27
Связь 2-х компов....


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





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский