[python-win32] How to reload ShellExtension?

Mark Hammond mhammond at skippinet.com.au
Tue Dec 20 04:58:26 CET 2005


> I am working with the ShellExtension context menu sample:
>
> win32comext\shell\demos\servers\context_menu.py
>
> My question after I change the code, how to I get it reloaded?
> --unregister and then --register won't do it. I have to log off and then
> log back in.

Its tricky.  Either restart explorer manually (using a utility like
"pskill") to automate it, or somehow arrange for your Python module to have
reload() called on it.  Exactly how you do the latter depends on your app,
but is generally not trivial.  At the end of the day though, your shell
extension is just another module in use by Python - in this case it just
happens to be hosted inside explorer.exe

Mark



More information about the Python-win32 mailing list