UAC shield icon incompatibility between Vista and 7
UAC shield icon on Windows 7 is different from those on Vista. Those on 7 is colored with blue and yellow. Those on Vista is with the four colors (red, green, blue and yellow.) But any document associate with this fact is not found.
So I think following program have version incompatibility:
- using the icon which is in your program's resource
- using
SystemIcons.Shield
(.NET Framework)
Why SystemIcons.Shield
has incompatibility? SystemIcons.Shield
yields an four-colors shield icon even if the program is running on windows 7. So, I think SystemIcons.Shield
shall not be used for UAC.
Using SHGetStockIconInfo()
with SIID_SHIELD
seems to be a correct answer. This code return the UAC shield icon colored with blue and yellow on windows 7, and colored with four colors on Vista. Example code is as follows:
If your program is a .NET Framework application, P/Invoke is required such as following code. Another example code is also available at CodeProject.
Note that SIID_SHIELD shall be used for UAC prompts only, which is written at SIID_SHIELD description at MSDN.
See also
- StockIcons for Windows Presentation Framework? Yves Dolce
- Step 4: Redesign Your UI for UAC Compatibility MSDN
- and API documents SHSTOCKICONINFO and SHGetStockIconInfo() on MSDN