Use the property IsFolder to check if the current object is a folder.
function IsFolder(Index: Integer): Boolean; overload;
Boolean: True if the passed Item parameter is a folder.
TShellBrowser.IsDrive
TShellBrowser.IsFolder
ShellControls.TJamShellList