Custom button in explorer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
colt
Posts: 291
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Custom button in explorer

Post by colt » 11 May 2021, 09:26

I have created a pdf viewer exe that shows the pdf in an activex gui control. This script replaced adobe viewer as the default program. Everything is great, except the button to print directly from explorer is missing. I think it is possible to attach this custom command to my exe, but it looks like it could be daunting. From here https://www.sevenforums.com/customization/96851-add-custom-explorer-bar-buttons-actions.html they talk about some registry keys that are associated with this functionality. I also found this https://www.nirsoft.net/utils/custom_explorer_toolbar.html but is seems like overkill.

Has anyone been able to tie a custom command set to their program type for use in explorer?
User avatar
mikeyww
Posts: 26593
Joined: 09 Sep 2014, 18:38

Re: Custom button in explorer

Post by mikeyww » 11 May 2021, 11:11

If you were planning to use the Explorer context menu, you could look up how to alter the target program for the print verb. An alternative is simply to set a hotkey that will use a PDF program's command line to print the selected file or files. You would not even need a button for that, though you could create a custom GUI for it if needed.
colt
Posts: 291
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Custom button in explorer

Post by colt » 11 May 2021, 13:35

Thanks for the suggestions, verb is the term I needed to look up. I can't change the interface because my coworker using this script doesn't adjust to change very well.

I managed to enable the verb button by adding this registry key.

Code: Select all

Computer\HKEY_CLASSES_ROOT\Applications\PDFViewer.exe\shell\print\command
with default string = 
"my path to my exe\pdfViewer.exe" "%1"
This opens the pdf in pdfViewer.exe. Now I just need to mimic the printing command that adobe uses.
Unfortunately, the adobe command does not exist in

Code: Select all

Computer\HKEY_CLASSES_ROOT\Applications\AcroRD32.exe\shell\print
They must be doing it a different way.
User avatar
mikeyww
Posts: 26593
Joined: 09 Sep 2014, 18:38

Re: Custom button in explorer

Post by mikeyww » 11 May 2021, 13:55

That would not be a surprise! I have not tried it, but there seem to be some PDF gurus on the forum who may be able to respond. I use the cheater's method myself, which is to use the free SumatraPDF and its command line.
Post Reply

Return to “Ask for Help (v1)”