本文整理汇总了C++中wxBitmap::CopyFromIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ wxBitmap::CopyFromIcon方法的具体用法?C++ wxBitmap::CopyFromIcon怎么用?C++ wxBitmap::CopyFromIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxBitmap
的用法示例。
在下文中一共展示了wxBitmap::CopyFromIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
/**
* Get the shield icon for UAC.
*
* This method returns the small shield icon for UAC
* on Vista and above. To be able to run this app also on
* previous Windows versions, the function pointer to
* SHGetStockIconInfo is obtained via GetProcAddress
* (i.e. no link-time dependency).
*/
bool Win32Utils::getShieldIcon(wxBitmap &shieldBM)
{
HMODULE hShellDLL;
HRESULT hr;
bool isOK = true;
HRESULT (CALLBACK* pfnSHGetStockIconInfo)(SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii);
hShellDLL = ::LoadLibraryW(L"shell32.dll");
if(hShellDLL == NULL)
return false;
(*(FARPROC*)&pfnSHGetStockIconInfo) = ::GetProcAddress(hShellDLL, "SHGetStockIconInfo");
if(pfnSHGetStockIconInfo)
{
SHSTOCKICONINFO stockInfo;
stockInfo.cbSize = sizeof(SHSTOCKICONINFO);
hr = pfnSHGetStockIconInfo(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, &stockInfo);
if(hr == S_OK)
{
wxIcon uacShieldIcon;
#if wxCHECK_VERSION(2, 9, 0)
uacShieldIcon.CreateFromHICON(stockInfo.hIcon);
#endif
shieldBM.CopyFromIcon(uacShieldIcon);
::DestroyIcon(stockInfo.hIcon);
}
else
isOK = false;
}
else
isOK = false;
::FreeLibrary(hShellDLL);
return isOK;
}