Alice Monique
Alice Monique

Reputation: 19

Accessing desktop application through url

Access desktop application(software) through URL? I thought of creating a simple application using visual studio of creating active x like the following: https://blogs.msdn.microsoft.com/asiatech/2011/12/05/how-to-develop-and-deploy-activex-control-in-c/

Upvotes: 0

Views: 1287

Answers (1)

user6921302
user6921302

Reputation:

For accessing apps through url's you have to register your app for the specific URL like this:

public void RegisterURLProtocol(string protocolName, string applicationPath, string description)
{
    // Create new Key for URL Protocol
    RegistryKey myKey=Registry.ClassesRoot.CreateSubKey(protocolName);

    // Assign Protocol
    myKey.SetValue(null, description);
    myKey.SetValue("URL Protocol", string.Empty);

    // Assign Shell Values
    Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell");
    Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open");
    myKey = Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open\\command");

    // Determine App who's receiving the URL calls with params
    myKey.SetValue(null, "\"" + applicationPath,  + "\" %1");
}

Have a nice day

Upvotes: 1

Related Questions