c++提取应用程序中的图标(绘制图标ico)

//提取应用程序中的图标

      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);

            //R


}

猜你喜欢

转载自blog.csdn.net/jangdong/article/details/80742763