HRESULT CRegisterExtension::RegisterPlayerVerbs()

in Docs-ContextMenuSample/ExplorerCommandVerb/RegisterExtension.cpp [540:564]


HRESULT CRegisterExtension::RegisterPlayerVerbs(PCWSTR const rgpszAssociation[], UINT countAssociation,
                                                PCWSTR pszVerb, PCWSTR pszTitle) const
{
    HRESULT hr = RegisterAppAsLocalServer(pszTitle, NULL);
    if (SUCCEEDED(hr))
    {
        // enable this handler to work with OpenSearch results, avoiding the downlaod
        // and open behavior by indicating that we can accept all URL forms
        hr = RegisterHandlerSupportedProtocols(L"*");

        for (UINT i = 0; SUCCEEDED(hr) && (i < countAssociation); i++)
        {
            hr = RegisterExecuteCommandVerb(rgpszAssociation[i], pszVerb, pszTitle);
            if (SUCCEEDED(hr))
            {
                hr = RegisterVerbAttribute(rgpszAssociation[i], pszVerb, L"NeverDefault");
                if (SUCCEEDED(hr))
                {
                    hr = RegisterVerbAttribute(rgpszAssociation[i], pszVerb, L"MultiSelectModel", L"Player");
                }
            }
        }
    }
    return hr;
}