Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Networking, Protocols & Data Formats

Appendix A: Registering an Application to a URL Protocol


To enable an application to handle a particular URL protocol, you must add a new key, with the appropriate keys and values, to the registry in HKEY_CLASSES_ROOT.

The new registry key must match the protocol scheme that is being added. For instance, to add the protocol note:, the key added to HKEY_CLASSES_ROOT should be note. Under this new key, the Default string value should be the name of the new protocol, and the URLProtocol string value should contain either protocol-specific information or an empty string. Also under the new key, a DefaultIcon key and a shell key should be added. The Default string value under the DefaultIcon key must be the file name to use as an icon for this new URL protocol. Under the shell key, a key using a verb (such as open) should be added. A command key and a DDEEXEC key can be added under the key using a verb. The values under the command and DDEEXEC keys are used to call the application.

The following example shows which registry values must be added to register a new application (notepad.exe in this example) to handle a new URL protocol (note:).

[HKEY_CLASSES_ROOT]
    [note]
        (Default) = "URL:Note Protocol"
        URL Protocol = ""
        [DefaultIcon]
            (Default) = "notepad.exe"
        [shell]
            [open]
                [command]
                    (Default) = "c:\windows\notepad.exe %1"

By adding these settings to the registry, attempts to navigate to URLs such as note:c:\myfile.txt would launch Notepad to edit the file c:\myfile.txt. Of course, all the commands supported under Shell\Open are supported, including DDEEXEC (in other words, "command" is not the only key you can put under the verb).


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site