Peter,
>I'm new to C# and need help to build a list if pidl's (ITEMIDLIST).
...
>Please show me a working sample of IShellFolder.GetUIObjectOf.
Do you need it for the third parameter of GetUIObjectOf? Assuming you
store your PIDLs as IntPtrs, you can declare the parameter type as
either ref IntPtr or as IntPtr[] depending on if you're going to pass
in one or multiple identifiers.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Peter Larsen - 31 Jan 2006 09:07 GMT
I think my problem is IExtractIcon or the way i deliver SHITEMID.
I have found the interface IShellFolder more than once on the internet, and
i am not sure which on is the right one:
-------------------------------------------------------------------------------
[PreserveSig()]
uint GetUIObjectOf(
IntPtr hwndOwner, // Handle to the owner window that the client
// should specify if it displays
// a dialog box or message box.
int cidl, // Number of file objects or subfolders specified
// in the apidl parameter.
[In(), MarshalAs(UnmanagedType.LPArray)] IntPtr[]
apidl, // Address of an array of pointers to ITEMIDLIST
// structures, each of which
// uniquely identifies a file object or subfolder
// relative to the parent folder.
[In()]
ref Guid riid, // Identifier of the COM interface object to
// return.
IntPtr rgfReserved, // Reserved.
[MarshalAs(UnmanagedType.Interface)]
out object ppv); // Pointer to the requested interface.
-------------------------------------------------------------------------------
[PreserveSig]
Int32 GetUIObjectOf(
IntPtr hwndOwner, // Handle to the owner window that the
client should specify if it displays
// a dialog box or message box.
UInt32 cidl, // Number of file objects or subfolders
specified in the apidl parameter.
IntPtr[] apidl, // Address of an array of pointers to
ITEMIDLIST structures, each of which
// uniquely identifies a file object or subfolder relative to
the parent folder.
Guid riid, // Identifier of the COM interface object to
return.
ref UInt32 rgfReserved, // Reserved.
out IntPtr ppv); // Pointer to the requested interface.
-------------------------------------------------------------------------------
Peter Larsen - 31 Jan 2006 14:38 GMT
No need of talking about this issue anymore - i have found a way ...
extractIcon.GetIconLocation(0, iconPath, MAX_PATH, ref iconIndex, ref
pwFlags);
uint GetIconLocation(int uFlags, [MarshalAs(UnmanagedType.LPStr)]
StringBuilder szIconFile, int
cchMax, ref int piIndex, ref int pwFlags);
Thanks for your time :-)
> Peter,
>
[quoted text clipped - 8 lines]
>
> Mattias