C++ - 使用 Windows Photo Viewer 使用 ShellExecute 打开图像
C++ - Opening an image with Windows Photo Viewer with ShellExecute
我想在我的C++程序中使用ShellExecute来强制打开W7和W10上的Windows照片查看器的tiff图像。默认情况下,tiff 图像是用我计算机上的另一个查看器打开的。目标是拥有一个灵活的解决方案,无论用于打开 tiff 图像的默认程序是什么,它都可以工作。
在cmd中运行它.exe可以满足我的需要:
rundll32 "%ProgramFiles%Windows Photo ViewerPhotoViewer.dll", ImageView_Fullscreen C:Tempmyimage.tif
现在,它将如何转换到我的 ShellExecute 参数中?我尝试了以下内容,但它不起作用。不确定是语法还是我没有向函数发送正确的参数。
ShellExecute(NULL, _T("open"), _T("rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen C:\Temp\myimage.tif"), NULL, NULL , SW_HIDE);
谢谢!
这在 Win 10 上对我有用
ShellExecute(
NULL, //-- hwnd
"open", //-- lpOperation
"rundll32.exe", //-- lpFile
//-- lpParameters
""C:\Program Files\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen C:\temp\P1000325.jpg",
NULL, //-- lpDirectory
SW_HIDE); //-- nShowCmd
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- C++:TypeDef使用元组
- 使用std::multimap迭代器创建std::list
- 从不同线程使用int64的不同字节安全吗
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- C Windows.h如何在Shellexecute中使用变量
- C++ - 使用 Windows Photo Viewer 使用 ShellExecute 打开图像
- 如何使用http:uri方案启动默认的Web浏览器并使用Shellexecute访问主页
- 如何调用 ShellExecute 以使用 C++ 打开具有特定程序的文件,而无需关联相同的文件扩展名
- 使用 ShellExecute c++ 打开长网址
- 为什么ShellExecute不能使用包含文件路径的LPCSTR变量
- 如何使用 CreateProcess 或 ShellExecute 来执行管道命令
- 如何使用 ShellExecute 通过 C++ 在 Windows 中打开 html 文件
- 使用ShellExecute在浏览器中打开文件
- 使用ShellExecute发送一个shell脚本给sqlite3.exe
- 使用ShellExecute可以使用多个参数运行icacl
- 在c++中使用ShellExecute打开URL - SW_SHOWMAXIMIZED不激活窗口
- c++中无法使用shellExecute函数打开.exe
- 使用shellExecute运行c#控制台应用程序
- 结束使用 ShellExecute 函数启动的C++程序的最佳方法是什么?