GME
13
|
00001 #include "stdafx.h" 00002 #include "UACUtils.h" 00003 00004 // Vista-dependent icon constants (copied from Commctrl.h) 00005 #define BCM_FIRST 0x1600 // Button control messages 00006 #define BCM_SETSHIELD (BCM_FIRST + 0x000C) 00007 00008 void CUACUtils::SetShieldIcon(const CButton& button, bool on) 00009 { 00010 /* 00011 HICON ShieldIcon; 00012 SHSTOCKICONINFO sii = {0}; 00013 sii.cbSize = sizeof(sii); 00014 00015 typedef HRESULT (*PSHGSII)(SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii); 00016 PSHGSII pSHGSII = (PSHGSII) GetProcAddress( 00017 GetModuleHandle(TEXT("Shell32.dll")), 00018 "SHGetStockIconInfo"); 00019 if(NULL != pSHGSII) 00020 pSHGSII(SIID_SHIELD, SHGFI_ICON | SHGFI_SMALLICON, &sii); 00021 00022 ShieldIcon = sii.hIcon; 00023 */ 00024 button.SendMessage(BCM_SETSHIELD, 0, on ? TRUE : FALSE); 00025 } 00026