I want to determine programmatically if my shell extension is called as a context menu handler or a drag-n-drop handler. I have registered my shell extension in proper location with same CLSID.
Registry:
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{E991C840-C1EB-455C-AD64-282473005C58}]
@="Test Context Menu"
[HKEY_CLASSES_ROOT\Directory\shellex\DragDropHandlers\TestDragDrop]
@="{E991C840-C1EB-455C-AD64-282473005C58}"
I have no problem with registry, my extension is loaded.
I think best place to check want be in DllGetClassObject or in IShellExtInit::Initialize.