How to add the UAC shield icon to program that still must target XP?

Posted by bsruth on Stack Overflow See other posts from Stack Overflow or by bsruth
Published on 2010-03-19T22:16:25Z Indexed on 2010/03/19 22:21 UTC
Read the original article Hit count: 137

Filed under:
|
|
|
|

I have a program that still must target Windows XP (_WIN32_WINNT 0x501), as most of our customers still use XP. However, we have been shipping Vista for a while, and are now pushing Windows 7 upgrades. For the software to work correctly on the newer OSs, there are a couple operations that require UAC elevation. I have the elevation code working, but would like to have the UAC icon present on the buttons that launch the UAC process. Unfortunately, all of the options defined in Microsoft's UAC UI document require _WIN32_WINNT 0x600 or newer.

Is there any way to get the appropriate UAC icon (Vista and 7 use different ones) to show on the button while still being able to target XP (where no icon will be shown)? I'm using C++, but may be able to adapt a .NET solution.

© Stack Overflow or respective owner

Related posts about uac

Related posts about windows-xp