0

I' trying to get my application associated with mailto handler. In Windows 8 it is possible only through Default Program association, so I need register my application and then call

IApplicationAssociationRegistrationUI *applicationAssociationRegistrationUI = 0;

CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
                     0,
                     CLSCTX_INPROC_SERVER,
                     IID_IApplicationAssociationRegistrationUI,
                     (LPVOID*)&applicationAssociationRegistrationUI);

if (applicationAssociationRegistrationUI)
    applicationAssociationRegistrationUI->LaunchAdvancedAssociationUI(L"MyApp");

So user can enable association.

However I just can't get registered.... I have added following registry entries:

HKCU\Software\
              MyFirm\
                     MyApp\
                           Capabilities\
                                        ApplicationDescription = "MyApp Description"
              RegisteredApplications\
                                     MyApp = "Software\MyFirm\MyApp\Capabilities"

What do I missing? Application doesn't shows in Default programs list, and association UI doesn't start at all...

P.S.: Have also tried with HKLM, but nothing helps...

Thank you in advance!

Xplatforms
  • 2,102
  • 17
  • 26

1 Answers1

1

Capabilities must be under HKLM. Here's the set of Registry settings you need to see your mailto handler application in Default Programs on WIndows 8:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\my.mailto]
@="URL:MailTo Protocol"
"EditFlags"=dword:00000002
"FriendlyTypeName"="My Mail Client"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\my.mailto\shell\open\command]
@="\"C:\\my-folder\\my-mail.exe\" \"%l\""

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities]
"ApplicationDescription"="Capability to send e-mail."
"ApplicationName"="A mail app"

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities\URLAssociations]
"mailto"="my.mailto"
regmagik
  • 574
  • 3
  • 14
  • 2
    Note that C:\\my-folder\\my-mail.exe\" must be a valid executable, AND it must have Version resource, AND Version.CompanyName must not be empty. Otherwise, A mail app would not show up in the Set Default Programs list. Here's how to add version if you don't have it already: http://stackoverflow.com/a/27394085/3220060. – regmagik Dec 10 '14 at 08:39