<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>James Finnigan : shell</title><link>http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx</link><description>Tags: shell</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>The Shell Extensions Approved list is *not* a complete list of shell extensions on the system</title><link>http://blogs.msdn.com/jamesfi/archive/2007/09/07/the-shell-extensions-approved-list-is-not-a-complete-list-of-shell-extensions-on-the-system.aspx</link><pubDate>Sat, 08 Sep 2007 07:42:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4822611</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/4822611.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=4822611</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=4822611</wfw:comment><description>&lt;p&gt;I've noticed that a number of different programs just look at the Approved list of shell extensions [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] and figure that all shell extensions will be in that list.&amp;nbsp; It's not true, because lots of folks don't really care about &lt;a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/gp/237.mspx?mfr=true" target="_blank"&gt;that policy&lt;/a&gt;.&amp;nbsp; I don't know how often it's used - it doesn't really make your system more secure as far as I can tell.&amp;nbsp; (It may reduce the TCO related to folks installing poorly written shell extensions.)&lt;/p&gt; &lt;p&gt;It also doesn't apply to all shell extensions.&amp;nbsp; There are many of them (probably some of them with HKCU extensibility) that haven't been moved to the policy system yet.&amp;nbsp; (So you should always register your shell extensions there, even if it doesn't seem to be necessary.)&lt;/p&gt; &lt;p&gt;(That said, it certainly does give you quite a few of them for very little work. On my system, it finds about 325/400 - about 80%.&amp;nbsp; Because of that,&amp;nbsp;if you're thinking about turning on this policy consider the fact that you'll be disabling 1 in 5 shell extensions; will&amp;nbsp;that generate more or less support calls?)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4822611" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Setup/default.aspx">Setup</category></item><item><title>Supplemental Registrations (aka. Context Menu Handers (etc) - where are they loaded from...)</title><link>http://blogs.msdn.com/jamesfi/archive/2007/09/06/supplemental-registrations-aka-context-menu-handers-etc-where-are-they-loaded-from.aspx</link><pubDate>Thu, 06 Sep 2007 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4779995</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/4779995.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=4779995</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=4779995</wfw:comment><description>&lt;P&gt;I've been thinking about the registration problem where you want to add a context menu (much of this applies to static verbs as well) to a file type (we'll say .ogg).&amp;nbsp; You don't want the default verb, you just want to add some verbs.&amp;nbsp; Because you don't want the default, you shouldn't put your progid in the HKCR\.ogg default value, so you put an entry under HKCR\.ogg\shellex\ContextMenuHandler.&amp;nbsp; And this works great.. until someone comes along and puts a progid in HKCR\.ogg's default value.&amp;nbsp; Look at the fallthrough logic below - #2 (where we registered), and #3 are only used if there is no progid!&amp;nbsp; 
&lt;P&gt;Fallthrough logic when loading context menu handlers (static verbs and then context menu handlers are collected from the following places): 
&lt;P&gt;&lt;STRONG&gt;(DO NOT USE THIS LOGIC&amp;nbsp;IN YOUR CODE&amp;nbsp;- it is a simplification of the real logic &lt;EM&gt;and &lt;/EM&gt;it will change.&amp;nbsp; Instead, use &lt;/STRONG&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms633715.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms633715.aspx"&gt;&lt;STRONG&gt;IQueryAssociations&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; or AssocQuery* for all these kinds of file association related things.)&lt;/STRONG&gt; 
&lt;OL&gt;
&lt;LI&gt;HKCR\&amp;lt;ProgID&amp;gt; 
&lt;LI&gt;HKCR\&amp;lt;.ext&amp;gt; (only if #1 does not exist) 
&lt;LI&gt;HKCR\Unknown (only if #1 does not exist) 
&lt;LI&gt;HKCR\SystemFileAssociations\&amp;lt;.ext&amp;gt; 
&lt;LI&gt;HKCR\SystemFileAssociations\&amp;lt;PerceivedType&amp;gt; 
&lt;LI&gt;HKCR\Folder (only used if the selected item has the SFGAO_FOLDER attribute, such as a folder, zip, cab, etc.) 
&lt;LI&gt;HKCR\* 
&lt;LI&gt;HKCR\AllFilesystemObjects&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;But there is a way!&amp;nbsp; You can register &lt;A href="http://msdn2.microsoft.com/en-us/library/aa969385.aspx#supplemental" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa969385.aspx#supplemental"&gt;supplemental verbs&lt;/A&gt; associated with the &lt;A href="http://msdn2.microsoft.com/en-us/library/aa969373.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa969373.aspx"&gt;SystemFileAssociations&lt;/A&gt; key.&amp;nbsp; Note that those keys (#4 and #5) are folded in regardless of the association having a progid registered.&amp;nbsp; In our example, that would be HKCR\SystemFileAssociations\.ogg\shellex\ContextMenuHandler&lt;/P&gt;
&lt;P&gt;The important thing here is that you should never put the registration under HKCR\&amp;lt;.ext&amp;gt;(!) because you should either be putting it under your progid (#1), or in SystemFileAssociations (#4).&amp;nbsp; Why do we disable #2 and #3 in those cases?&amp;nbsp; If folks are interested, I'll talk more about that later - or feel free to guess. :)&lt;/P&gt;
&lt;P&gt;(A quick comment about #5 - I think it is often misused.&amp;nbsp; Applications don't know how to handle very many perceived types (one exception is text).&amp;nbsp; How are you going to handle the "video" perceived type?&amp;nbsp; I guarantee that we'll come out with more codecs/container formats, etc.&amp;nbsp; Unless you can guarantee that you can handle everything that will map into the perceived type, don't register for it - instead register for the individual associations that you really &lt;EM&gt;can&lt;/EM&gt; handle.)&lt;/P&gt;
&lt;P&gt;This technique is used for a lot of other things besides context menu handlers.&amp;nbsp; It's also used for &lt;A href="http://msdn2.microsoft.com/en-us/library/bb266532.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/bb266532.aspx"&gt;Property Handlers for Windows Search&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library//aa905327.aspx#installinganduninstalling" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library//aa905327.aspx#installinganduninstalling"&gt;Windows Imaging Component codecs&lt;/A&gt;, etc, etc, etc.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR&gt;James&lt;/P&gt;
&lt;P&gt;[Update: finished the sentence beginning "In our example, that would be..."]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4779995" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Setup/default.aspx">Setup</category></item><item><title>Installing shell extensions - please complain here</title><link>http://blogs.msdn.com/jamesfi/archive/2007/08/10/installing-shell-extensions-please-complain-here.aspx</link><pubDate>Sat, 11 Aug 2007 04:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4328374</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/4328374.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=4328374</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=4328374</wfw:comment><description>&lt;P&gt;So... I've been looking more closely at Wix and I think I'm going to build some custom actions to do a really good job installing shell extensions.&amp;nbsp; Which ones do you find most problematic?&amp;nbsp; I realize this is a bit of a change of pace for the blog, so I'll probably hit a few other forums, but please feel free to add comments/complaints about which extensions are problematic.&lt;/P&gt;
&lt;P&gt;Maybe you've already done the work to install these properly, but in some cases that can be quite complicated and I could see a lot of folks just accepting some minor bugs and moving on.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I'll start: &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Protocol Handlers (&lt;A href="http://msdn2.microsoft.com/en-us/library/bb266527.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb266527.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb266527.aspx&lt;/A&gt;)&amp;nbsp;and Schema Extensions (&lt;A href="http://msdn2.microsoft.com/en-us/library/ms647576.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms647576.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms647576.aspx&lt;/A&gt;).&amp;nbsp; Both of these &lt;EM&gt;require&lt;/EM&gt; custom actions to be installed correctly - and there's no standard for it so everyone is probably doing it themselves which is going to lead to some really inconsistent behavior.&amp;nbsp; None of that is going to help system stability at all.&lt;/P&gt;
&lt;P&gt;Another one I came across recently was installing a shell folder that should appear on the desktop.&amp;nbsp; I added it to the desktop namespace but until the user refreshes the desktop it isn't going to appear.&amp;nbsp; You need to send a SHChangeNotify to get it to show up without user intervention.&amp;nbsp; Anyway, there's no standard action for that.&amp;nbsp; So unless you can accept a shortcut to the shell folder (which sends a notification), you'll want a CA there as well.&amp;nbsp; And there again, you want to send as minimal a notification as possible to avoid having the system reload everything when all that you needed is a new icon to show up.&lt;/P&gt;
&lt;P&gt;File Associations:&lt;BR&gt;This one is going to be a bit of a laundry list of issues, but I'll start off the first couple issues.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;If previous handlers didn't register under openwith then your registration may blow away any record that they wanted to handle that file association.&lt;/LI&gt;
&lt;LI&gt;If you register under a meta-type like TXTFile and then someone else claims .txt then you don't get invoked at all.&lt;/LI&gt;
&lt;LI&gt;Man that thing is complicated.&amp;nbsp; Way, way complicated. (I'm still learning the subtleties - feel free to correct me if I miss a beat.)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;So there's a start - let me know&amp;nbsp;as you come across other issues.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR&gt;James&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4328374" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Setup/default.aspx">Setup</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Wix/default.aspx">Wix</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/install/default.aspx">install</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/MSI/default.aspx">MSI</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/explorer/default.aspx">explorer</category></item><item><title>RegNamespace sample up on codeplex</title><link>http://blogs.msdn.com/jamesfi/archive/2007/02/16/regnamespace-sample-up-on-codeplex.aspx</link><pubDate>Sat, 17 Feb 2007 00:07:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1691408</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/1691408.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=1691408</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=1691408</wfw:comment><description>&lt;p&gt;&lt;a href="http://www.codeplex.com/RegNamespace" atomicselection="true"&gt;&lt;img height="61" src="http://blogs.msdn.com/blogfiles/jamesfi/WindowsLiveWriter/RegNamespacesampleuponcodeplex_A18E/image%7B0%7D%5B6%5D.png" width="60" align="left"&gt;&lt;/a&gt;&lt;a href="http://www.codeplex.com/RegNamespace/Release/ProjectReleases.aspx" atomicselection="true"&gt;&lt;img height="55" src="http://blogs.msdn.com/blogfiles/jamesfi/WindowsLiveWriter/RegNamespacesampleuponcodeplex_A18E/CP_banner_75x55_dnld%5B5%5D.jpg" width="75" align="right"&gt;&lt;/a&gt; Scott, Jerry, Thayn and&amp;nbsp;I have whipped up a sample of indexing the registry, as well as a shell folder (namespace extension) for viewing it.&amp;nbsp; It's great to be able to search the registry via the index and it's great sample of how to create a shellfolder, protocol handler, and even an IFilter.&amp;nbsp; So head on over to &lt;a href="http://www.codeplex.com/RegNamespace"&gt;the codeplex site&lt;/a&gt; and check out &lt;a href="http://www.codeplex.com/RegNamespace/SourceControl/ListDownloadableCommits.aspx"&gt;the source code&lt;/a&gt;, or if you're more interested in having it than seeing how it's build, just download &lt;a href="http://www.codeplex.com/RegNamespace/Release/ProjectReleases.aspx"&gt;the binaries&lt;/a&gt; and enjoy!&lt;/p&gt; &lt;p&gt;This is something that we're looking to improve over time, adding features and generally fleshing it out to be a rich, complete&amp;nbsp;experience.&amp;nbsp; We're not yet to feature parity with Regedit, but it won't be too long.&lt;/p&gt; &lt;p&gt;If you're interested in samples related to shell programming also check out &lt;a href="http://shellrevealed.com/files/folders/code_samples/default.aspx"&gt;shellrevealed&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1691408" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/Download/default.aspx">Download</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/CodePlex/default.aspx">CodePlex</category></item><item><title>WMI Folder - codeplex project</title><link>http://blogs.msdn.com/jamesfi/archive/2007/01/10/wmi-folder-codeplex-project.aspx</link><pubDate>Thu, 11 Jan 2007 01:03:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1446110</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/1446110.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=1446110</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=1446110</wfw:comment><description>&lt;p&gt;&lt;img src="http://www.codeplex.com/App_Themes/CodePlex/images/banner_toplogo.jpg" align="left"&gt; Well, I've put the WMI folder code &lt;a href="http://www.codeplex.com/WMIFldr"&gt;up on codeplex&lt;/a&gt;.&amp;nbsp; Please remember that this code is very much pre-alpha.&amp;nbsp; I think that this will be a good way to share the code, allow others to contribute, etc.&amp;nbsp; If it works well, then I will probably create codeplex projects for some of the other things that I'm putting together.&lt;/p&gt; &lt;p&gt;If you're interested in contributing, leave a comment here or via the codeplex project.&lt;br clear="all"&gt;Happy new year!&lt;br&gt;James&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1446110" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/WMI/default.aspx">WMI</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/CodePlex/default.aspx">CodePlex</category></item><item><title>Getting a Path from an IDList</title><link>http://blogs.msdn.com/jamesfi/archive/2006/12/01/getting-a-path-from-an-idlist.aspx</link><pubDate>Fri, 01 Dec 2006 14:44:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1183089</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/1183089.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=1183089</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=1183089</wfw:comment><description>&lt;div&gt;Not much to this - but I notice searches for this coming to my blog, so I might as well provide the answer.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Use &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetpathfromidlist.asp?frame=true"&gt;SHGetPathFromIDList&lt;/a&gt; - as long as the pidl is part of the file system, this will succeed.&amp;nbsp; If you don't need a file system path, you can pass something like &lt;a href="http://msdn2.microsoft.com/en-gb/library/aa966495.aspx"&gt;PKEY_ItemFolderPathDisplay&lt;/a&gt;&amp;nbsp;to &lt;a href="http://msdn2.microsoft.com/en-gb/library/ms632781.aspx"&gt;IShellItem2::GetProperty&lt;/a&gt;&amp;nbsp;(use &lt;a href="http://msdn2.microsoft.com/en-gb/library/ms632781.aspx"&gt;SHCreateItemFromIDList&lt;/a&gt;&amp;nbsp;to go from a pidl to an IShellItem2).&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Incidently, if you want to surface search results in Windows Vista, make sure your IShellFolder also supplies &lt;a href="http://msdn2.microsoft.com/en-gb/library/aa966496.aspx"&gt;PKEY_ItemFolderPathDisplayNarrow&lt;/a&gt;&amp;nbsp;or you'll end up looking silly (if there's a difference between your parsing path and your display path).&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Enjoy,&lt;/div&gt; &lt;div&gt;James&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1183089" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category></item><item><title>WMI Shell Folder GetDisplayNameOf - untangling the flags</title><link>http://blogs.msdn.com/jamesfi/archive/2006/11/06/wmi-shell-folder-getdisplaynameof-untangling-the-flags.aspx</link><pubDate>Tue, 07 Nov 2006 00:24:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1004855</guid><dc:creator>jamesfinnigan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jamesfi/comments/1004855.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesfi/commentrss.aspx?PostID=1004855</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jamesfi/rsscomments.aspx?PostID=1004855</wfw:comment><description>&lt;div&gt;So I have a bit of a beef with&amp;nbsp;GetDisplayNameOf - I don't like the flags.&amp;nbsp; I understand that when it was created, the flexibility of flags made a ton of sense.&amp;nbsp; It wasn't well understood what potentially wildly different uses might be needed,&amp;nbsp;and flags are a good alternative to a giant enumeration.&amp;nbsp; But I think there are really only about 4 possibilities that matter most of the time (caveat: I'm still pretty new to shell programming).&amp;nbsp; It's a pain to figure out the flags and there are combinations that don't even make sense.&amp;nbsp; It seems to make a lot more sense to me to use an enumeration (like in &lt;a href="http://windowssdk.msdn.microsoft.com/en-us/library/ms649337.aspx"&gt;IShellItem&lt;/a&gt;).&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Anyway, I ended up liking a solution that very similar to the one that was put into the Registry sample that a few of us are putting together (more on that later).&amp;nbsp; I created four different functions for the different GetDisplayNameOf possibilities and hopefully the table that links them to the flags isn't too scary.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;HRESULT CWMIFldr::GetDisplayNameOf( &lt;?xml namespace="" ns="urn:schemas-microsoft-com:office:office" prefix="o" ?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;/* [in] */&lt;/span&gt; PCUITEMID_CHILD pidl,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;/* [in] */&lt;/span&gt; SHGDNF uFlags,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;/* [out] */&lt;/span&gt; STRRET *pName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;TRACEFNENTER();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;HRESULT hr;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;ZeroMemory(pName, &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(*pName));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (!ILIsEmpty(pidl))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;const&lt;/span&gt; DisplayNameFn s_rgSIGDNMapping[2][2] = &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;// unfriendly&lt;span style="mso-spacerun: yes"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;// friendly&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;{{&amp;amp;CWMIFldr::_GetAbsoluteParsingName}, {&amp;amp;CWMIFldr::_GetAbsoluteDisplayName}}, &lt;span style="color: green"&gt;// absolute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;{{&amp;amp;CWMIFldr::_GetRelativeParsingName}, {&amp;amp;CWMIFldr::_GetRelativeDisplayName}}, &lt;span style="color: green"&gt;// relative&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;bool&lt;/span&gt; fRelative = (uFlags &amp;amp; SHGDN_INFOLDER) == SHGDN_INFOLDER;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;bool&lt;/span&gt; fFriendly = (uFlags &amp;amp; SHGDN_FORPARSING) != SHGDN_FORPARSING &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;|| (uFlags &amp;amp; SHGDN_FORADDRESSBAR) == SHGDN_FORADDRESSBAR;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;PWSTR pszDisplay;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;hr = (&lt;span style="color: blue"&gt;this&lt;/span&gt;-&amp;gt;*s_rgSIGDNMapping[fRelative][fFriendly])(pidl, &amp;amp;pszDisplay);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (SUCCEEDED(hr))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;pName-&amp;gt;uType = STRRET_WSTR;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;pName-&amp;gt;pOleStr = pszDisplay;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;hr = E_NOTIMPL;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;TRACEFNEXIT();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; hr;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; mso-bidi-language: he; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;-- &lt;br&gt;This posting is provided "AS IS" with no warranties, and confers no rights. &lt;br&gt;Use of included script samples are subject to the terms specified at &lt;a href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;u&gt;&lt;font color="#0066cc"&gt;http://www.microsoft.com/info/cpyright.htm&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1004855" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesfi/archive/tags/shell/default.aspx">shell</category><category domain="http://blogs.msdn.com/jamesfi/archive/tags/WMI/default.aspx">WMI</category></item></channel></rss>