 | Resource HackerResource Hacker is a handy utility for editing shortcuts and menus of executable programs. It can do more, but that is all I need it for. If you want to add or modify shortcuts and menus in your favourite programs to
make them more consistent or easier to use, Resource Hacker will do it fairly easily. Disclaimer:
If you have problems with a program after using this tool, don’t expect support from the software vendor, or from me. Use it entirely at your own risk. The example given no longer works with recent versions of PDF-XChange, but the principle is the same for other programs, so I leave it as a general case. | Adding A ShortcutThis tutorial shows you how to add a shortcut to export a page to an image from the free PDF Viewer, PDF-XChange. The item is already on the file menu, but there is no shortcut. If it was something you did very frequently, you
might like to use Control + Shift + E to show the export as image dialogue. Run Resource Hacker, and open the executable file for PDF-XChange by browsing to it from the file, open menu. You will see here that the program function for Export to Image is 32945. Copy this number to the clipboard. To add the chosen shortcut to the menu we must use the same syntax as is used for
the shortcuts by the File Open, and File Save items, which is \t for a Tab, and the text to display. So we would modify “To Image...” to “To Image...\tCtrl+Shift+E.” This won’t enable the shortcut, it will just show it on the menu to remind the user what the shortcut is. We now need to add an accelerator key (shortcut).Accelerator KeysOpen the Accelerators tree and check that the shortcut you wish to use is not already used. Here, VK-E is used, but not with both modifiers, so we can use Control + Shift + E as the shortcut to export to an image. Copy the existing line, paste it, then modify it with the function code 32945 for export to image. When you have finished editing, click on the Compile Script button to update the shortcuts, (this will check
for syntax errors), then save the executable file from the File menu (or use Control S). A copy of the original executable file will be created in the same directory automatically before saving the modified version. It will be named “PDF-XChange_original.exe.” | Modifying a Menu Here, I have modified the original Arrange menu in PagePlus X2, moving the items for the stacking order of objects from the Arrange menu, to a new submenu, which I have named “Stacking &Order.” The access key for the submenu, “O” is defined by the ampersand. Each item on the submenu has been given a new Accelerator Key shortcut too. Fewer items on the main menu, makes it easier to read, and the
less used stacking order items are grouped neatly on the submenu as you see on the right.
The Original shortcuts use Ctrl Up/Down cursor keys, which often led to errors as one moved an object instead of changing its stacking order, or changed its stacking order instead of moving it. Now all of the Stacking Order commands use the Page Down and Page Up keys with Control and Control/Shift key
modifiers. This is much easier to remember, and less prone to errors. Page Up and Page Down keys alone, will move to the next and previous page in the document as usual. After defining the new menu, we have to add accelerator key shortcuts as before, copying the program function numbers 32821, 32807, 32812, and 32808 to the appropriate accelerator items. I sorted the accelerator shortcuts alphabetically and
pasted them back into Resource Hacker. Then I arranged them in logical order. The commands “Next” and “Prior” refer to Page Down and Page Up on the keyboard. | SummaryI made numerous similar modifications to menus and shortcuts in a few programs to suit the way that I work. It is not particularly difficult to do, but it is hard to keep track of different file versions,
and exactly what changes have been made. Whenever the program needs to be patched, or reinstalled, you will lose all of your changes, so make sure that you keep a record in a word-processor file, or with screen shots. |
|
| |