Howdy!
Actually i'm making the typicall 'Shell's namespace's objects enumeration' kinda program and i have faced a (very little) difficulty.
First i call SHGetDesktopFolder i order to get a interface to the desktop and from then on i bind to the child elements and so on and so forth.
The problem is this:
How do i get the Desktop's PIDL ? Is there any way to do this ?
Basically i want to get the System's image list and to do this i need to pass a PIDL. And i want to pass the desktop's PIDL.
I have browsed the examples around and have seen that most of them get the system's image list handle passing a ptr to "c:\",0 to SHGetFileInfo instead of passing a PIDL as i want to do.

Any ptr is appreciated in advanced as per usual :)


LatiCOM.
Posted on 2001-08-27 16:37:46 by latigo
PIDL??


Huh? Wha's that?
Posted on 2001-08-27 21:50:36 by Ernie
latigo,

How about SHGetDesktopFolder or GetSpecialFolder (something
like that) ?
Posted on 2001-08-28 13:24:56 by Xtreme
I think what latigo mean is form IShellFolder::EnumObjects():




HRESULT EnumObjects( HWND hwndOwner,
// Handle of owner window

DWORD grfFlags,
// ems to include in enumeration

LPENUMIDLIST *ppenumIDList
// Pointer to IEnumIDList

);






possibly the last parameter is a PIDL. But latigo, this is an "out" parameter, you will receive it and dont need to supply it.

japheth
Posted on 2001-08-29 02:07:38 by japheth
Ernie: From MSDN : '...For the Shell API, namespace objects are usually identified by a pointer to their ITEMIDLIST structure, or PIDL..'

What i wanted was the Desktop's PIDL.
With SHGetDesktopFolder i get the IShellFolder interface for the desktop folder. Then with IShellFolder::EnumObjects i get each member of the desktop's PIDL and so on.
Anyway i think i'm making a mistake here. If i get I think it's more of a misconception of mine.
I'll keep on chewing COM concepts..

Thanks Ernie, Xtreme & Japeth
Posted on 2001-08-31 12:34:14 by latigo
latigo,

as far as I know there is a mistake in your reply:

"Then with IShellFolder::EnumObjects i get each member of the desktop's PIDL and so on."

In COM, to enumerate object you always need to get an "enum" object first. This enum object you gain with the above function. Then you use the returned IEnumIDList pointer to "enum" the objects you want (with function IEnumIDList::Next).

japheth
Posted on 2001-09-02 07:44:24 by japheth
Latigo,
I just ran into the same problem. Here is how to get the
Desktop PIDL.



LOCAL PIDL:DWORD

invoke SHGetSpecialFolderLocation,hWin,
CSIDL_DESKTOP,addr PIDL
;Get Desktop Icon
invoke SHGetFileInfo,PIDL,0,addr ptrSHFILEINFO,sizeof SHFILEINFO,
SHGFI_PIDL or SHGFI_ICON or SHGFI_SMALLICON
push ptrSHFILEINFO.iIcon
pop ptrTV_INSERTSTRUCT.item.iImage
push ptrSHFILEINFO.iIcon
pop ptrTV_INSERTSTRUCT.item.iSelectedImage

Maybe this will help you :alright:
Posted on 2001-11-18 17:25:06 by anon
Thanks mate!

Latigo
Posted on 2001-11-19 09:37:24 by latigo