MFC使用Windows图片查看器

BOOL CCommonFun::PictureWindows(const CString &strPicFile, CString &sError)
{
    CString strSystemDir="";
    ::GetSystemDirectory(strSystemDir.GetBuffer(256), 256);
    strSystemDir.ReleaseBuffer();

    CString strRundll = strSystemDir + "\rundll32.exe";

    CString strParm;
    strParm.Format("%s//shimgvw.dll imageview_fullscreen %s", strSystemDir, strPicFile); 

    HINSTANCE hNewExe = ShellExecute(NULL, "Open", strRundll, strParm, NULL, SW_SHOW);
    if ((DWORD)hNewExe <= 32)
    {
        CString sFormat;
        sFormat.Format("return value:%d
", (DWORD)hNewExe);
        sError = sFormat;
        return FALSE;
    }
    return TRUE;
}

原文地址:https://www.cnblogs.com/hzcya1995/p/13318346.html