a oe @snddlZddlZddlZddlmZmZGdddZddZddZe d krjdd l m Z e j eeed dS) N)shellshellconc@s.eZdZdZdZdZejgZdgZ ddZ dS)ShellExtensionzPython.ShellExtension.CopyHookz)Python Sample Shell Extension (copy hook)z&{1845b6ba-2bbd-4197-b930-46d8651497c1} CopyCallBackc Cs(td|||||||t|ddtjS)NrzAllow operation?ZCopyHook)printwin32guiZ MessageBoxwin32conZMB_YESNO)selfZhwndfuncflagsZsrcNameZsrcAttrZdestNameZdestAttrr JC:\Program Files\Certbot\pkgs\win32comext\shell\demos\servers\copy_hook.pyrs zShellExtension.CopyCallBackN) __name__ __module__ __qualname__Z _reg_progid_ _reg_desc_ _reg_clsid_rZ IID_ICopyHookZ_com_interfaces_Z_public_methods_rr r r r rs rcCslddl}||jdtj}||dd|jtj||jdtj}||dd|jtjttjddS)Nr#directory\shellex\CopyHookHandlers\*\shellex\CopyHookHandlers\zregistration complete.) winreg CreateKeyHKEY_CLASSES_ROOTrr SetValueExREG_SZrr)rkeyr r r DllRegisterServer"src Csddl}z||jdtj}Wn:tyZ}z"ddl}|j|jkrFWYd}~n d}~00z||jdtj}Wn:ty}z"ddl}|j|jkrWYd}~n d}~00ttjddS)Nrrrzunregistration complete.) r DeleteKeyrrr WindowsErrorerrnoENOENTr)rrZdetailsrr r r DllUnregisterServer2s(  r __main__)register)Zfinalize_registerZfinalize_unregister) Z pythoncomrrZwin32com.shellrrrrr rZwin32com.serverr"ZUseCommandLiner r r r  s