I would like to use ShellExecute in my C++ program to force the opening of a tiff image with Windows Photo Viewer on W7 and W10. By default, tiff images are opened with another viewer on my machine. The goal is to have a flexible solution that will work no matter what is the default program used to open tiff images.
Running this in cmd.exe does what I need:
rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen C:\Temp\myimage.tif
Now, how would that translate in my ShellExecute parameters? I tried the following, but it does not work. Not sure if it's syntax or I am not sending the right parameters to the function.
ShellExecute(NULL, _T("open"), _T("rundll32 \"%ProgramFiles%\\Windows Photo Viewer\\PhotoViewer.dll\", ImageView_Fullscreen C:\\Temp\\myimage.tif"), NULL, NULL , SW_HIDE);
Thanks!