04-11-2017 12:07 PM
How can I invoke the print command that you get in explorer by right clicking a file in Windows Explorer? I have a PNG file that I want to be printed, but I want to prompt the user on the printer to use, printer options, scaling, etc. If you right click a PNG and choose print there is a nice window that comes up with a preview of the image and all kinds of settings like printer options. I found by this command brings up the PhotoViewer and from there you can click print, but I'd like to go straight into the print dialog.
rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen "C:\temp\Temp.png"
I looked through the registry but couldn't find the command.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
04-12-2017 12:11 AM
.NET should be able to handle this one way or another. The snippet was adapted from https://stackoverflow.com/questions/19662130/print-image-using-windows-print-image-dialog
04-12-2017 07:32 AM
A million kudos to you sir (in the form of one) if you are going to NI Week I'll buy you a beer to thank you.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-12-2017 05:10 PM - edited 04-12-2017 05:12 PM
This works too (only for files which have a Print menu in the Explorer popup menu, but that's the same for the .Net method, and in fact .Net calls exactly this function internally, well most likely ShellExecuteExW() but that is about the same).