I'm very happy that I found the wonderful mad Collection, which is very easy to use, well-documented and in my case - for the madShell - the easiest way to handle the often strange Shell objects of the ShellAPI.
Indeed - I worked a lot to understand the concept of the shell routines, including CSIDL, PItemIDLists, etc., but the way the IShellObj interface can be used makes all these things understandable.
The only disadvantage is that the source is not included so I don't know *how* it works exactly, but that's the decision of the author. Thanks for the great work!

the madshell Unit allocates a new Shell object for performing the action with the shell item 'c:\whatever.txt'. Is the structure correctly dis-allocated when a procedure / the application ends or Do I have to dis-allocate such objects for my own? I'm working on a Treeview routine made with ShellObj calls and I ask myself what about all those allocated shell items?

Well, indeed, ShellObj frees the memory pretty much like using temporary strings. That's fascinating! All I have to do is to put anything I want to do with the ShellObj structure within the WITH context. Outside the with structure the object is already freed.

Allow me to publish the code of my testing tree view here (so other can see how easy madShell makes the stuff):

Well, it's only a testing project - nothing real big. It only shows 2 levels of the tree - but you can right-click to get the explorer context menu.

Now I have to take some time to study what madShell definitely performs.
You have very high knowledge of the internal structures of the Shell (but not only), and of course you did that what the ShellAPI programmers did not: Making an understandable structured object for programmers. Thanks for that very good work!