Windows URL protocol handler in python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john.burton@jbmail.com

    #1

    Windows URL protocol handler in python?

    Is there a way to make a handler in python presumably using the win32
    extensions to handle URLS of a specific type when they are given to
    windows?

    For example if I want to handle
    myprotocol://server/id
    using my own python program?
    Any suggestions or references would be appreciated.

  • John J. Lee

    #2
    Re: Windows URL protocol handler in python?

    "john.burton@jb mail.com" <john.burton@jb mail.com> writes:
    [color=blue]
    > Is there a way to make a handler in python presumably using the win32
    > extensions to handle URLS of a specific type when they are given to
    > windows?
    >
    > For example if I want to handle
    > myprotocol://server/id
    > using my own python program?
    > Any suggestions or references would be appreciated.[/color]

    Maybe pywin32 can do it. Probably ctypes can do it.

    Read up on COM monikers (eg. Essential COM by Don Box).


    John

    Comment

    • JanC

      #3
      Re: Windows URL protocol handler in python?

      john.burton@jbm ail.com schreef:
      [color=blue]
      > Is there a way to make a handler in python presumably using the win32
      > extensions to handle URLS of a specific type when they are given to
      > windows?
      >
      > For example if I want to handle
      > myprotocol://server/id
      > using my own python program?
      > Any suggestions or references would be appreciated.[/color]

      That's just an entry in the Windows registry

      As an example, this is how Xnews does it:

      ------------------------------ news-url.reg ------------------------------
      Windows Registry Editor Version 5.00

      [HKEY_CLASSES_RO OT\news]
      @="URL:news Protocol"
      "URL Protocol"=""
      "EditFlags"=hex :02,00,00,00

      [HKEY_CLASSES_RO OT\news\Default Icon]
      @="\"C:\\Xnews\ \Xnews.exe\""

      [HKEY_CLASSES_RO OT\news\shell]

      [HKEY_CLASSES_RO OT\news\shell\o pen]

      [HKEY_CLASSES_RO OT\news\shell\o pen\command]
      @="\"C:\\Xnews\ \Xnews.exe\" /url=\"%1\""
      ------------------------------ news-url.reg ------------------------------


      --
      JanC

      "Be strict when sending and tolerant when receiving."
      RFC 1958 - Architectural Principles of the Internet - section 3.9

      Comment

      Working...