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

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

            //


	}

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐