Windows Explorer Print through specified application

3

0

How to setup the default application to use for print.

Sequence to test

  1. Open Windows Explorer (Win+e)
  2. Right click on a tiff image
  3. Select "print" item
  4. A custom application (for example IrfanView) should do the printout now to physical printer

Windows explorer print menu

The print should now go though a specified program the user can setup to print tiff files. Instead, Microsoft Windows sends the tiff file to Windows Photo viewer. If MsPaint is set as default application for this file extension, it sends the tiff file to MsPaint correctly (but MsPaint does do bad image printout without centering image). A custom application should be the solution to print out an specified file extension. How to setup?

What we tried without success

  1. Open Windows Explorer (Win+e)
  2. Select "Open with" > "Choose another app"
  3. Select application with hook "Always use this app to open .tiff files"
  4. OK

Default application

Select custom application (example IrfanView) Select custom application Explorer > Print > goes to Windows Photo viewer instead of any custom application.


After check of Registry entry ProgID - still default windows application for print (suggested by @harrymc): Regedit After check of Registry entry ProgID

Test with print command in registry without success Test with print command

Nasenbaer

Posted 2019-03-15T10:31:32.953

Reputation: 548

What do you have in the registry at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice? – harrymc – 2019-03-18T13:13:04.210

I checked Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.jpg\ShellEx\PropertyHandler with default application GUID in it. I now checked your path and found: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice with one entry of Hash=5aLtQqOSl74=, which I have no idea what that is for. – Nasenbaer – 2019-03-18T13:55:20.023

If you don't have an entry named ProgId then you have not set IrfanView (or other) as the handler for tiff images. – harrymc – 2019-03-18T14:32:43.947

Reviewed: There is ProgId=ACDSee Pro 10.tiffin my case. But it does not use the value for print. It takes it for open the file only. – Nasenbaer – 2019-03-19T10:28:55.450

I updated the question with screenshot attached on bottom. – Nasenbaer – 2019-03-19T10:36:08.510

I guess the print command might be in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ACDSee Pro 10.tif‌f\shell\print\command, but I don't use this software. – harrymc – 2019-03-19T11:09:47.863

Well guessed. There are entries in \HKEY_LOCAL_MACHINE\SOFTWARE\Classes\... and also a lot with shell but none of them takes effect to the requested, Windows print context menu as requested. – Nasenbaer – 2019-03-20T08:59:45.007

Does this happen when booting in Safe Mode? Try also sfc /scannow to verify Windows integrity.

– harrymc – 2019-03-20T09:04:45.747

The problem is common on all computers. The issue comes to the question: how to setup this print context menu in Registry. There is always popping up the default Microsoft Photo Viewer print dialog in case it seems no other application is interested to use this menu. Can you use it with any other application by using the registry key of you above? (similar) – Nasenbaer – 2019-03-20T09:31:41.390

Try to modify or delete the registry entry of HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\print\command (export it first for backup). – harrymc – 2019-03-23T21:09:49.033

I saw this entry. Default value is %SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1 so I changed with my own application "C:\Source\Tools\trunk\EasyPrintHandler\EasyPrintHandler\bin\Debug\EasyPrintHandler.exe" /print %1. With no change when using print button in Windows Explorer. Still Windows PhotoViewer print opens. That is why I started this ticket. I Monitored with Sysinternals Process Monitor but it only reads this Registry Key. Perhaps someone has already working experience with it. – Nasenbaer – 2019-03-25T08:26:20.783

I did some exploring - results below. – harrymc – 2019-03-25T10:12:18.447

Did you have a chance to test all the options I gave in my answer? – sancho.s Reinstate Monica – 2019-03-27T12:58:05.590

Answers

0

This pertains to a general extension, not only .tiff (but using it as an example).

  1. Check if the extension has a File descriptor and Perceived type: go to HKEY_CLASSES_ROOT\.tiff, check the values of
    (Predetermined) TIFImage.Document ← FileDescriptor
    Content Type (image/tiff) ← ContentType
    PerceivedType (image) ← PerceivedType.

Using print for the action:

  1. Check in / modify HKEY_CLASSES_ROOT\[FileDescriptor]\shell\[action]\command

  2. Check in / modify HKEY_CLASSES_ROOT\SystemFileAssociations\[PerceivedType]\shell\[action]\command

  3. Check in / modify HKEY_LOCAL_MACHINE\SOFTWARE\Classes\[FileDescriptor]\shell\[action]\command

As for the value to use, it is likely <path to your executable> "%1".

Note that:

  1. Depending on your executable / paths / use of environment variables, you may need to escape names and/or parameters.

  2. Some apps run from dlls, possibly with parameters. E.g., what I have in my Win 10 for HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\print\command is %SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1.

  3. I have no admin rights in my current system, so I cannot test a few issues. I am not sure about the precedence of the various settings above.

sancho.s Reinstate Monica

Posted 2019-03-15T10:31:32.953

Reputation: 2 404

0

I have used Process Monitor to trace the execution of the Print command from the context menu in Explorer.

I have found that one of the last operations before starting the print is to read the registry key of HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\print\command, which currently contains %SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1.

I have replaced this value by another, killed and restarted explorer.exe, then did again Print, without any change. Although the new value was read by Explorer, it still launched the Photos application instead of the indicated one.

My conclusion: Some Explorer update by Microsoft has disabled the use of this registry key. Explorer still reads it but does not use it. Using the Photos application for printing seems to now be hard-wired into Explorer.

The most you can do is signal this regression as a bug to Microsoft through the Feedback Hub application, and hope for a fix.

harrymc

Posted 2019-03-15T10:31:32.953

Reputation: 306 093