Hello everybody,

I'm trying to find recycle bin using ShGetSpecialFolderLocation. Does anybody know how to use this function? I'm getting errors cuz ITEMIDLIST isn't defined. Where do I find shtypes.h and shtypes.idl equates for this structure? Any links or suggestions much appreciated.

best regards,

czDrillard
Posted on 2004-12-04 16:46:13 by czDrillard
Hi,

That function is used in the Files library I have posted on my website. It also has a link to Microsofts site in the comments. See the "CreateSpecialFolderLink" function of the lib. Note that it uses an undocumented (until the settlement API) function:

; Load undocumented ILFree function...

invoke GetModuleHandleA,offset szShell32
mov [hLib],eax
invoke GetProcAddress,eax,155
mov [pFreePIDL],eax

invoke SHGetSpecialFolderLocation,NULL,[csidl],offset PIDL
invoke SHGetPathFromIDListA,[PIDL],offset Recyclepath
invoke [pFreePIDL],[PIDL] ; ILFree


For values for csidl see the following link...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp

The recycle bin is CSIDL_BITBUCKET (0x000a)
Posted on 2004-12-04 17:22:05 by donkey
Thanks Donkey for your reply,

:oops: I screwed up here, a slip of the keyboard... When I declared my structure, used:

ppidl _ITEMIDLIST <>

instead of

ppidl ITEMIDLIST <>

All assembles without errors now.

best regards,

czDrillard
Posted on 2004-12-04 18:27:25 by czDrillard
No probs czDrillard,

Since the function returns an ITEMIDLIST structure and since the data it contains is not really useful except as a whole block you don't really need to formally structure the information. I usually just allocate 32 dwords to hold the list and don't bother with the structure as I have no reason to ever modify or examine the information. Ofcourse in C with the strict typing of returned data they have to pass the address of an ITEMIDLIST but in assembler there is no need, just use

PIDL DD 32 DUP (?)

for the example above
Posted on 2004-12-05 04:54:57 by donkey