propsys.dll 中有 WINDOWSPROPERTYDESCRIPTIONS 资源。该资源描述了所有系统道具。一些属性的drawcontrol 等于IconList。示例:
<propertyDescription name="System.StorageProviderUIStatus" formatID="{E77E90DF-6271-4F5B-834F-2DD1F245DDA4}" propID="2">
<searchInfo reIndexPatterns="" processReIndexPatternsImmediately="true" inInvertedIndex="false" isColumn="false">
</searchInfo>
<typeInfo type="Blob" isInnate="true" isViewable="true">
</typeInfo>
<labelInfo label="@propsys.dll,-42289">
</labelInfo>
<displayInfo defaultColumnWidth="10">
<drawControl control="IconList">
</drawControl>
</displayInfo>
</propertyDescription>
所有此类道具的类型都等于“Blob”。所以 Blob 就是答案。
更新
我的小调查。
唯一已知的(我所知道的)显示图标的处理程序是 OneDrive。截图:
我获得了 OneDrive 文件之一的 System.StorageProviderUIStatus 属性的值。价值转储:
如您所见,这不是图像或图标。这是 [MS-PROPSTORE] 中描述的属性存储二进制文件。解码形式:
System.PropList.StatusIcons = prop:System.StorageProviderState;System.StorageProviderCustomStates
System.PropList.StatusIconsDisplayFlag = 3
StorageProviderState = 2
StorageProviderCustomStates = (binary data)
嵌入式 Property Store 二进制文件中的二进制数据。其解码形式:
StorageProviderFullyQualifiedId = OneDrive!S-1-5-21-782054983-1121033576-3753986437-1001!Personal|79D9464945C2A3B2!331
对于简单的图标描述来说,一切看起来都相当困难。也许我错了,Blob 类型不是唯一的答案。
解决方案
propdesc 文件内容:
<propertyDescription name="DummyUIState" formatID="{8A560909-320E-4E6A-A6C4-A95C50B77084}" propID="5001">
<searchInfo columnIndexType="NotIndexed"/>
<labelInfo label="DummyUIState"/>
<typeInfo type="Blob" isInnate="true" isViewable="true"/>
<displayInfo defaultColumnWidth="10">
<drawControl control="IconList"/>
</displayInfo>
</propertyDescription>
<propertyDescription name="DummyState" formatID="{8A560909-320E-4E6A-A6C4-A95C50B77084}" propID="5000">
<searchInfo columnIndexType="NotIndexed"/>
<labelInfo label="DummyState"/>
<typeInfo type="UInt32" isInnate="true" isViewable="true"/>
<displayInfo displayType="Enumerated">
<enumeratedList>
<enum name="None" value="0" text="@propsys.dll,-42290"/>
<enum name="Sparse" value="1" text="@propsys.dll,-42291">
<image res="%systemroot%\system32\imageres.dll,-1404"/>
</enum>
<enum name="InSync" value="2" text="@propsys.dll,-42292">
<image res="%systemroot%\system32\imageres.dll,-1400"/>
</enum>
<enum name="Pinned" value="3" text="@propsys.dll,-42293">
<image res="%systemroot%\system32\imageres.dll,-1405"/>
</enum>
<enum name="PendingUpload" value="4" text="@propsys.dll,-42294">
<image res="%systemroot%\system32\imageres.dll,-1401"/>
</enum>
<enum name="PendingDownload" value="5" text="@propsys.dll,-42303">
<image res="%systemroot%\system32\imageres.dll,-1401"/>
</enum>
<enum name="Transferring" value="6" text="@propsys.dll,-42296">
<image res="%systemroot%\system32\imageres.dll,-1401"/>
</enum>
<enum name="Error" value="7" text="@propsys.dll,-42315">
<image res="%systemroot%\system32\imageres.dll,-1402"/>
</enum>
<enum name="Warning" value="8" text="@propsys.dll,-42316">
<image res="%systemroot%\system32\imageres.dll,-1403"/>
</enum>
<enum name="Excluded" value="9" text="@propsys.dll,-42319"/>
<enum name="Pending" value="10" text="@propsys.dll,-42324">
<image res="%systemroot%\system32\imageres.dll,-1401"/>
</enum>
</enumeratedList>
</displayInfo>
</propertyDescription>
当 shell 请求 DummyUIState 时,您必须使用 Property Store Binary File 创建 blob。属性存储二进制文件必须包含以下数据:
- Key System.PropList.StatusIcons,类型 VT_LPWSTR 的值等于 prop:DummyState
- Key System.PropList.StatusIconsDisplayFlag,类型 VT_UI4 的值等于 2(2 - 仅图标,1 - 图标 + 文本)
- 键 DummyState,值类型 VT_UI4。此值定义图标。
就是这样。在 Windows 10 上测试。屏幕截图: