获取 exe dll 资源图标

    TCHAR tc[255];
    memset(tc,0,255);
    QString(m_strAppPath+"/xxx.exe").toWCharArray(tc);
#ifdef WINCE
    HICON hIconL,hIconS;
    HICON hIcon = ExtractIconEx(tc,0,&hIconL,&hIconS,1);
#else
    HICON hIcon = ExtractIcon((HINSTANCE)GetClassLong(winId(),GCL_HICON),tc,0);
#endif
    QPixmap pix = QPixmap::fromWinHICON(hIcon);
    setWindowIcon(QIcon(pix));

你可能感兴趣的:(获取 exe dll 资源图标)