{"id":14413,"date":"2010-04-02T07:00:00","date_gmt":"2010-04-02T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/04\/02\/why-do-non-folders-in-my-shell-namespace-extension-show-up-in-the-folder-tree-view\/"},"modified":"2010-04-02T07:00:00","modified_gmt":"2010-04-02T07:00:00","slug":"why-do-non-folders-in-my-shell-namespace-extension-show-up-in-the-folder-tree-view","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100402-00\/?p=14413","title":{"rendered":"Why do non-folders in my shell namespace extension show up in the folder tree view?"},"content":{"rendered":"<p>A customer was having trouble with their shell namespace extension:<\/p>\n<blockquote class=\"q\"><p> When we click the [+] button next to our shell namespace extension  in the folder tree view, the tree view shows both files and folders, even though it&#8217;s supposed to show only folders. Our <code>IShell&shy;Folder::Get&shy;Attributes&shy;Of<\/code> does return the correct values for <code>SFGAO_FOLDER<\/code> (including it for the folders and omitting it for the non-folders). What are we doing wrong? <\/p><\/blockquote>\n<p> The tree view enumerates the children of a folder by calling <code>IShell&shy;Folder::Enum&shy;Objects<\/code> and passing the <code>SHCONTF_FOLDERS<\/code> flag while omitting the <code>SHCONTF_NONFOLDERS<\/code> flag. This means that it is only interested in enumerating child folders. Child non-folders should be excluded from the enumeration.\n It so happens that the customer&#8217;s shell namespace extension was not respecting the <code>SHCONTF_FOLDERS<\/code> and <code>SHCONTF_NONFOLDERS<\/code> flags; it always enumerated all objects regardless of what the caller requested.<\/p>\n<p> Fixing the enumerator fixed the problem. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer was having trouble with their shell namespace extension: When we click the [+] button next to our shell namespace extension in the folder tree view, the tree view shows both files and folders, even though it&#8217;s supposed to show only folders. Our IShell&shy;Folder::Get&shy;Attributes&shy;Of does return the correct values for SFGAO_FOLDER (including it for [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-14413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A customer was having trouble with their shell namespace extension: When we click the [+] button next to our shell namespace extension in the folder tree view, the tree view shows both files and folders, even though it&#8217;s supposed to show only folders. Our IShell&shy;Folder::Get&shy;Attributes&shy;Of does return the correct values for SFGAO_FOLDER (including it for [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=14413"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=14413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=14413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=14413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}