I've collected everything within my knowledge, that could be helpful towards this goal, in case anyone has the knowledge to take this further.
I intend to try and create a few simple applications in C++, and to learn more about C++ generally, and shell extensions, but it could be many months or longer, before I achieve that.
==================================================
Open single/multiple files as individual files:
- Pass the filename as a command-line parameter.
[add 'open with Notepad' to all files][if a shortcut, the target is opened]
HKEY_CLASSES_ROOT\*\shell\Open with Notepad\command
(Default) REG_SZ notepad.exe "%1"
[add 'open with WordPad' to all files][if a shortcut, the target is opened]
HKEY_CLASSES_ROOT\*\shell\Open with WordPad\command
(Default) REG_SZ "C:\Program Files\Windows NT\Accessories\wordpad.exe" "%1"
==================================================
Open single/multiple files as a group:
- Perhaps pass the Explorer window hWnd as a command-line parameter.
- Then retrieve the paths from the window (a folder window or Desktop).
- Otherwise get the list of files more directly by whatever means Explorer provides.
- We could look at 7-Zip to get some hints.
If I do '7-Zip, Add to archive...', and check Task Manager:
E.g. select some files in an Explorer window, for the folder 'New Folder':
"C:\Program Files\7-Zip\7zG.exe" a -i#7zMap20728:678:7zEvent24246 -ad -slp- -- "New Folder"
"C:\Program Files\7-Zip\7zG.exe" a -i#7zMap5190:572:7zEvent25545 -ad -slp- -- "New Folder"
"C:\Program Files\7-Zip\7zG.exe" a -i#7zMap730:678:7zEvent27379 -ad -slp- -- "New Folder"
E.g. select some files on Desktop:
"C:\Program Files\7-Zip\7zG.exe" a -i#7zMap2723:350:7zEvent8418 -ad -slp- -- "Desktop"
In the registry we see:
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\7-Zip
(Default) REG_SZ {23170F69-40C1-278A-1000-000100020000}
==================================================
To get the paths from an Explorer Window:
for oWin in ComObjCreate("Shell.Application").Windows
To get the paths from Desktop:
get full paths of selected files on Desktop and Common File Dialogs - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31135
==================================================
Some comments on creating a GUID (globally unique identifier):
ObjRegisterActive - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?t=6148
==================================================; Register our object so that other scripts can get to it. The second
; parameter is a GUID which I generated. You should generate one unique
; to your script. You can use [CreateGUID](http://goo.gl/obfmDc).
ObjRegisterActive(ActiveObject, "{6B39CAA1-A320-4CB0-8DB4-352AA81E460E}")
Some links on creating a shell extension:
Writing a shell extension in plain C++ - CodeProject
https://www.codeproject.com/Articles/58 ... -Cplusplus
C++ Windows Shell context menu handler (CppShellExtContextMenuHandler) sample in C++, Windows Shell Script for Visual Studio 2010
https://code.msdn.microsoft.com/windows ... l-410a709a
==================================================
So the question is if there is some template we can use or modify, in order to choose a string/some strings for the Explorer context menu item(s) text (possibly with a popup menu/popup menus), and then determine some command-line parameters for AutoHotkey.exe or a compiled script to receive, or some code for handling whatever communication means Explorer provides.
Thanks for reading.