MFC使用Windows图片查看器

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\n", (DWORD)hNewExe);
        sError = sFormat;
         return  FALSE;
    }
     return  TRUE;
}

你可能感兴趣的:(MFC使用Windows图片查看器)