c++提取应用程序中的图标(绘制图标ico)
//提取应用程序中的图标 CSttring m_strIcoPath = L"xx.exe"; CRect m_rcItem; //绘制区域HICON hIcon = ::ExtractIcon(GetModuleHandle(NULL), m_strIcoPath, 0);if (hIcon != NULL){Graphics graphics(hDC);B
·
//提取应用程序中的图标
CSttring m_strIcoPath = L"xx.exe";
CRect m_rcItem; //绘制区域
HICON hIcon = ::ExtractIcon(GetModuleHandle(NULL), m_strIcoPath, 0);
if (hIcon != NULL)
{
// HDC hDC = GetDc(m_hWnd);
Graphics graphics(hDC);
Bitmap bitmap(hIcon);
graphics.DrawImage(&bitmap, m_rcItem.left, m_rcItem.top);
DestroyIcon(hIcon);
//
}
更多推荐
所有评论(0)