Win7 namespace extension determine if IShellItem is file or folder
See the question and my original answer on StackOverflowYou can use the IShellItem::GetAttributes method, like this:
SFGAOF att = 0;
if (SUCCEEDED(pItem->GetAttributes(SFGAO_FOLDER, &att))) // pItem is a IShellItem*
{
if (att & SFGAO_FOLDER)
{
// it's a folder
}
}