Starting with the Windows Vista PlatformSDK,
defining the symbol
STRICT_
before including shell header files
changes declarations that previously had simply used
ITEMIDLIST
now use
one of various types which are more clear about what
type of ID list is being used.
Think of it as the STRICT
macro for the shell.
The more precise names emphasize the form of the ID list:
ITEMID_
represents an item ID relative to some implied shell folder. The item ID is followed by a null terminator and is therefore exactly oneCHILD SHITEMID
long. In file-system speak, this is a "file name."IDLIST_
represents an item ID list relative to some implied shell folder. It can consist of any number ofRELATIVE SHITEMID
structures concatenated together, followed by a null terminator. This item ID list must be used in conjunction with theIShellFolder
it is associated with. In file-system speak, this is a "relative path."IDLIST_
represents an item ID list relative to the desktop root folder. It too can be any length. This item ID list must be used in conjunction with theABSOLUTE IShellFolder
returned bySHGetDesktopFolder
. In file-system speak, this is a "fully-qualified absolute path." (An absolute ID list is the special case of a relative ID list where the implied shell folder is the desktop root folder.)ITEMID_
represents an array of pointers toCHILD_ ARRAY ITEMID_
objects, where all of theCHILD ITEMID_
objects are children of the same shell folder parent. The array must be used in conjunction with that parent shell folder.CHILD
These new types were introduced to help catch common programming errors
when using the shell namespace.
For example, if you try to pass an array of absolute pidls
to IShellFolder::
,
you will get a type mismatch compiler error because that method
takes an
ITEMID_
,
and the thing you passed is not an array of
ITEMID_
pointers.
You are encouraged to turn on strict mode when compiling code that uses the shell namespace, but to preserve source code backward compatibility, the setting is off by default.