[python-win32] Re: Windows "Browse to" message

Roger Upole rwupole at msn.com
Wed Mar 1 07:08:36 CET 2006


vince at weaktight.com wrote:
> When you open an html file or click on a link outside of a browser, it opens it
> in your default browser. What I'd like to do is to catpure this message and
> grab the URL text string to see where the browser is going.
> 
> I was looking at PyHook, but I don't think it intercepts all windows messages,
> and I'm not sure this is a windows message per se.
> 
> Any suggestions?
> 
> thanks

For opening local files, there's a registered handler for the file type.
Take a look at HKEY_CLASSES_ROOT\htmlfile\shell\open\command
which specifies the program that will open the file.  You might be able
to substitute your own handler, which just logs the request and then
passes it off to the original program.  The handler for internet protocol is
under HKEY_CLASSES_ROOT\HTTP\shell\open\command,
although you'd probably also need to change all handlers that point
to your web browser (https, ftp, etc)

     hth
        Roger



More information about the Python-win32 mailing list