Explorer Shell extensions are here!
ny_r_marquez at yahoo.com
Tue Dec 9 21:32:28 CET 2003
Great! That is just what I needed. Thank you, M.H. and all other
Pythonistas for all your great work and generous spirit.
Joe Francia <usenet at soraia.com> wrote in message news:<k85Bb.2630449$Of.400994 at news.easynews.com>...
> R.Marquez wrote:
> > I just happened to bump into this today when I went to the Win32
> > Python Extensions page. I think the M.H. and his team are a bit too
> > modest.
> > Quote:
> > "win32com.shell grows many more interfaces, allowing Python to operate
> > as a nearly complete shell extension, and to interact with the shell
> > interfaces. See the win32comext\shell\demos\server directory for
> > examples."
> > This is something I had been waiting for a while, and even submited a
> > "feature request" about it. So, since I hadn't heard any thing about
> > it, I figure there may be a few more like me that would enjoy knowing
> > about this.
> I _do_ enjoy knowing about this ;>) Thanks for the tip.
> > (Now, if I could only figure out how to make a context menu that would
> > show up for any file of folder... ;)
> In the demo "context_menu.py", replace the register and unregister bits
> with the code below. Run context_menu.py with either the --register or
> --unregister switch, as appropiate.
> def DllRegisterServer():
> import _winreg
> folder_key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT,
> folder_subkey = _winreg.CreateKey(folder_key, "ContextMenuHandlers")
> folder_subkey2 = _winreg.CreateKey(folder_subkey, "PythonSample")
> _winreg.SetValueEx(folder_subkey2, None, 0, _winreg.REG_SZ,
> file_key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT,
> file_subkey = _winreg.CreateKey(file_key, "ContextMenuHandlers")
> file_subkey2 = _winreg.CreateKey(file_subkey, "PythonSample")
> _winreg.SetValueEx(file_subkey2, None, 0, _winreg.REG_SZ,
> print ShellExtension._reg_desc_, "registration complete."
> def DllUnregisterServer():
> import _winreg
> folder_key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
> file_key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
> except WindowsError, details:
> import errno
> if details.errno != errno.ENOENT:
> print ShellExtension._reg_desc_, "unregistration complete."
More information about the Python-list