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

Вниз

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

 
Delph1   (2004-03-18 14:42) [0]

Win2k, для конкретного пользователя, который в данный момент работает. Спасибо.


 
Delph1   (2004-03-18 14:42) [0]

Win2k, для конкретного пользователя, который в данный момент работает. Спасибо.


 
Delph1   (2004-03-18 15:02) [1]

Отвечаю сам. Уже нашел.

function TFormMain.getDesktopDir: String;
var
 PIDL: PItemIDList;
 Path: LPSTR;
const
 CSIDL_DESKTOP = $0000;
begin
 Path := StrAlloc(MAX_PATH);
 SHGetSpecialFolderLocation(Self.Handle, CSIDL_DESKTOP, PIDL);
 if SHGetPathFromIDList(PIDL, Path) then
  Result := Path
   else
    Result := "";
end;


 
Delph1   (2004-03-18 15:02) [1]

Отвечаю сам. Уже нашел.

function TFormMain.getDesktopDir: String;
var
 PIDL: PItemIDList;
 Path: LPSTR;
const
 CSIDL_DESKTOP = $0000;
begin
 Path := StrAlloc(MAX_PATH);
 SHGetSpecialFolderLocation(Self.Handle, CSIDL_DESKTOP, PIDL);
 if SHGetPathFromIDList(PIDL, Path) then
  Result := Path
   else
    Result := "";
end;


 
Тимохов ©   (2004-03-18 15:12) [2]

сам не пользовался, но в доке про нее написано WindowsNT none


 
Тимохов ©   (2004-03-18 15:12) [2]

сам не пользовался, но в доке про нее написано WindowsNT none


 
Тимохов ©   (2004-03-18 15:13) [3]

сам не пользовался, но в доке про нее написано WindowsNT none


 
Тимохов ©   (2004-03-18 15:13) [3]

сам не пользовался, но в доке про нее написано WindowsNT none


 
Dimka Maslov ©   (2004-03-18 15:16) [4]

>Тимохов ©   (18.03.04 15:12) [2]
сам не пользовался, но в доке про нее написано WindowsNT none
Здрасьте пожалуста.

Function Information

Minimum DLL Version shell32.dll version 4.7 or later
Custom Implementation No
Header shlobj.h
Import library shell32.lib
Minimum operating systems Windows NT 4.0, Windows 95

See Also


 
Dimka Maslov ©   (2004-03-18 15:16) [4]

>Тимохов ©   (18.03.04 15:12) [2]
сам не пользовался, но в доке про нее написано WindowsNT none
Здрасьте пожалуста.

Function Information

Minimum DLL Version shell32.dll version 4.7 or later
Custom Implementation No
Header shlobj.h
Import library shell32.lib
Minimum operating systems Windows NT 4.0, Windows 95

See Also


 
Тимохов ©   (2004-03-18 15:44) [5]

а если в дельфи 6 нажать f1, то windows nt none
ладно, будем верить msdn :))


 
Тимохов ©   (2004-03-18 15:44) [5]

а если в дельфи 6 нажать f1, то windows nt none
ладно, будем верить msdn :))


 
Юрий Зотов ©   (2004-03-18 15:45) [6]

> Тимохов ©   (18.03.04 15:13) [3]

В доке написано следующее:
Now Supported on Windows NT
:о)


 
Юрий Зотов ©   (2004-03-18 15:45) [6]

> Тимохов ©   (18.03.04 15:13) [3]

В доке написано следующее:
Now Supported on Windows NT
:о)


 
Тимохов ©   (2004-03-18 15:54) [7]

спорить не будем, но у меня в д6 now нет.

вопрос: всю инетересующую автора вопроса информацию можно поднять из \Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. Кто вообще как делает обычно: из реестра берет или SHGetSpecialFolderLocation пользуется?


 
Тимохов ©   (2004-03-18 15:54) [7]

спорить не будем, но у меня в д6 now нет.

вопрос: всю инетересующую автора вопроса информацию можно поднять из \Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. Кто вообще как делает обычно: из реестра берет или SHGetSpecialFolderLocation пользуется?


 
Игорь Шевченко ©   (2004-03-18 16:14) [8]


> Кто вообще как делает


SHGetSpecialFolderLocation

Только так.


> спорить не будем, но у меня в д6 now нет.


Выбрось D6


 
Игорь Шевченко ©   (2004-03-18 16:14) [8]


> Кто вообще как делает


SHGetSpecialFolderLocation

Только так.


> спорить не будем, но у меня в д6 now нет.


Выбрось D6


 
Игорь Шевченко ©   (2004-03-18 16:14) [9]


> Кто вообще как делает


SHGetSpecialFolderLocation

Только так.


> спорить не будем, но у меня в д6 now нет.


Выбрось D6


 
Игорь Шевченко ©   (2004-03-18 16:14) [9]


> Кто вообще как делает


SHGetSpecialFolderLocation

Только так.


> спорить не будем, но у меня в д6 now нет.


Выбрось D6


 
Юрий Зотов ©   (2004-03-18 19:23) [10]

> Тимохов ©   (18.03.04 15:54) [7]
> у меня в д6 now нет.

Не верю. (с) К.С. Станиславский.
Это есть в поставляемой вместе с Delphi справке по API, как минимум, уже в D5 (только что проверил). Насколько помню, это было и в более ранних.


 
Юрий Зотов ©   (2004-03-18 19:23) [10]

> Тимохов ©   (18.03.04 15:54) [7]
> у меня в д6 now нет.

Не верю. (с) К.С. Станиславский.
Это есть в поставляемой вместе с Delphi справке по API, как минимум, уже в D5 (только что проверил). Насколько помню, это было и в более ранних.


 
Тимохов ©   (2004-03-18 20:24) [11]


> Юрий Зотов ©   (18.03.04 19:23) [10]

Я вру чтобы обелить себя? Не тот возраст :)
Вообще о чем спорим - в msdn написано же что я не прав. Честь справки дельфи пытаемся сохранить? :)))

Из quick info windows nt no.

[New - Windows 95]

WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(;

   HWND  hwndOwner,  
   int  nFolder,  
   LPITEMIDLIST  * ppidl
  );
Retrieves the location of a special folder.

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 Value

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


 
Тимохов ©   (2004-03-18 20:24) [11]


> Юрий Зотов ©   (18.03.04 19:23) [10]

Я вру чтобы обелить себя? Не тот возраст :)
Вообще о чем спорим - в msdn написано же что я не прав. Честь справки дельфи пытаемся сохранить? :)))

Из quick info windows nt no.

[New - Windows 95]

WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(;

   HWND  hwndOwner,  
   int  nFolder,  
   LPITEMIDLIST  * ppidl
  );
Retrieves the location of a special folder.

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 Value

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


 
Тимохов ©   (2004-03-18 20:26) [12]

могу еще справку дельфи присалать, если станиславский не верит :)))))


 
Тимохов ©   (2004-03-18 20:26) [12]

могу еще справку дельфи присалать, если станиславский не верит :)))))


 
Германн ©   (2004-03-19 03:16) [13]

Проверил только что. В справке по Д4!!! написано "SHGetSpecialFolderLocation" - [Now Supported on Windows NT]!


 
Германн ©   (2004-03-19 03:16) [13]

Проверил только что. В справке по Д4!!! написано "SHGetSpecialFolderLocation" - [Now Supported on Windows NT]!


 
Cobalt ©   (2004-03-19 06:14) [14]

И в QuickInfo написано WinNT, Win95 - Yes; Win32s - No


 
Cobalt ©   (2004-03-19 06:14) [14]

И в QuickInfo написано WinNT, Win95 - Yes; Win32s - No


 
Тимохов ©   (2004-03-19 10:34) [15]

Во дурацкий спор :)))):
1. Темы нет - я же сразу пизнал, что в мсдн написано все верно, т.е. был в 2 не прав.
2. Не верят честному человеку

Господа Грерманн и Cobalt, давайте мыло - пришлю установленную у меня в д6 версию справки по win32 (cobalt согласие на получение). Хотя какая мне разница - верите вы или нет :)))))


 
Тимохов ©   (2004-03-19 10:34) [15]

Во дурацкий спор :)))):
1. Темы нет - я же сразу пизнал, что в мсдн написано все верно, т.е. был в 2 не прав.
2. Не верят честному человеку

Господа Грерманн и Cobalt, давайте мыло - пришлю установленную у меня в д6 версию справки по win32 (cobalt согласие на получение). Хотя какая мне разница - верите вы или нет :)))))


 
Cobalt ©   (2004-03-19 14:50) [16]

Тимохов ©  a-b-c-d at inbox.ru


 
Cobalt ©   (2004-03-19 14:50) [16]

Тимохов ©  a-b-c-d at inbox.ru


 
Тимохов ©   (2004-03-19 17:13) [17]

Во прикол -

набираю в редакторе SHGetSpecialFolderLocation, жму ф1, получаю win nt no.

захожу в меню выбирю help\windows sdk далее через предметный указатель ищу SHGetSpecialFolderLocation получаю now supported on win nt (как в общем и все тут говорят).

Вопрос: что это за хелп, который открывается по ф1 из редактора? Почему они разные? При том могу гарантировать, что никогда перенастройкой хелпов в дельфи не занимался. Может ли быть, что это дистрибуция дельфи левая?


 
Тимохов ©   (2004-03-19 17:13) [17]

Во прикол -

набираю в редакторе SHGetSpecialFolderLocation, жму ф1, получаю win nt no.

захожу в меню выбирю help\windows sdk далее через предметный указатель ищу SHGetSpecialFolderLocation получаю now supported on win nt (как в общем и все тут говорят).

Вопрос: что это за хелп, который открывается по ф1 из редактора? Почему они разные? При том могу гарантировать, что никогда перенастройкой хелпов в дельфи не занимался. Может ли быть, что это дистрибуция дельфи левая?


 
Cobalt ©   (2004-03-19 22:41) [18]

Посмотри, что написано в *.cnt, *.toc


 
Cobalt ©   (2004-03-19 22:41) [18]

Посмотри, что написано в *.cnt, *.toc



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

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

Наверх





Память: 0.54 MB
Время: 0.05 c
11-1068747888
miek
2003-11-13 21:24
2004.05.09
Отличить KOL от VCL


11-1066636980
ALEF
2003-10-20 12:03
2004.05.09
неполный mck.zip ?


3-1081444607
YurikGl
2004-04-08 21:16
2004.05.09
Проблемы с распространением DbExpress


1-1082717242
афвуд
2004-04-23 14:47
2004.05.09
Как установить дробный разделитель для чисел в своей проге?


1-1082471791
UnDISCOvery
2004-04-20 18:36
2004.05.09
ActionToolBar. Проблемы с отрисовкой. Как бороть ???





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский