summaryrefslogtreecommitdiff
path: root/catchcopy-windows-explorer-plugin/Reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'catchcopy-windows-explorer-plugin/Reg.h')
-rwxr-xr-xcatchcopy-windows-explorer-plugin/Reg.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/catchcopy-windows-explorer-plugin/Reg.h b/catchcopy-windows-explorer-plugin/Reg.h
new file mode 100755
index 0000000..6bc9a26
--- /dev/null
+++ b/catchcopy-windows-explorer-plugin/Reg.h
@@ -0,0 +1,103 @@
+#ifndef _REG_H_
+#define _REG_H_
+#pragma once
+
+//#define CATCHCOPY_ROOT_MODE
+
+#include <windows.h>
+#include <winreg.h>
+//
+// FUNCTION: RegisterInprocServer
+//
+// PURPOSE: Register the in-process component in the registry.
+//
+// PARAMETERS:
+// * pszModule - Path of the module that contains the component
+// * clsid - Class ID of the component
+// * pszFriendlyName - Friendly name
+// * pszThreadModel - Threading model
+//
+// NOTE: The function creates the HKCR\CLSID\{<CLSID>} key in the registry.
+//
+// HKCR
+// {
+// NoRemove CLSID
+// {
+// ForceRemove {<CLSID>} = s '<Friendly Name>'
+// {
+// InprocServer32 = s '%MODULE%'
+// {
+// val ThreadingModel = s '<Thread Model>'
+// }
+// }
+// }
+// }
+//
+HRESULT RegisterInprocServer(PCWSTR pszModule, const CLSID& clsid,
+ PCWSTR pszFriendlyName, PCWSTR pszThreadModel);
+
+
+//
+// FUNCTION: UnregisterInprocServer
+//
+// PURPOSE: Unegister the in-process component in the registry.
+//
+// PARAMETERS:
+// * clsid - Class ID of the component
+//
+// NOTE: The function deletes the HKCR\CLSID\{<CLSID>} key in the registry.
+//
+HRESULT UnregisterInprocServer(const CLSID& clsid);
+
+
+//
+// FUNCTION: RegisterShellExtContextMenuHandler
+//
+// PURPOSE: Register the context menu handler.
+//
+// PARAMETERS:
+// * pszFileType - The file type that the context menu handler is
+// associated with. For example, '*' means all file types; '.txt' means
+// all .txt files. The parameter must not be NULL.
+// * clsid - Class ID of the component
+// * pszFriendlyName - Friendly name
+//
+// NOTE: The function creates the following key in the registry.
+//
+// HKCR
+// {
+// NoRemove <File Type>
+// {
+// NoRemove shellex
+// {
+// NoRemove ContextMenuHandlers
+// {
+// {<CLSID>} = s '<Friendly Name>'
+// }
+// }
+// }
+// }
+//
+HRESULT RegisterShellExtContextMenuHandler(
+ PCWSTR pszFileType, const CLSID& clsid, PCWSTR pszFriendlyName);
+
+
+//
+// FUNCTION: UnregisterShellExtContextMenuHandler
+//
+// PURPOSE: Unregister the context menu handler.
+//
+// PARAMETERS:
+// * pszFileType - The file type that the context menu handler is
+// associated with. For example, '*' means all file types; '.txt' means
+// all .txt files. The parameter must not be NULL.
+// * clsid - Class ID of the component
+//
+// NOTE: The function removes the {<CLSID>} key under
+// HKCR\<File Type>\shellex\ContextMenuHandlers in the registry.
+//
+HRESULT UnregisterShellExtContextMenuHandler(
+ PCWSTR pszFileType, const CLSID& clsid);
+
+LONG RecursiveDeleteKey(HKEY hKeyParent, PCWSTR szKeyChild);
+#endif //_REG_H_