Share via


IMsgrSessionManager::RegisterApplication Method

Deprecated. Registers an application for use with a Messenger client.

Syntax

HRESULT RegisterApplication(      
    BSTR bstrAppGUID,
    BSTR bstrAppName,
    BSTR bstrAppURL,
    BSTR bstrPath,
    LONG ulFlags
);

Parameters

  • bstrAppGUID
    [in] BSTR that specifies the GUID of the application. Maximum character length is 39.
  • bstrAppName
    [in] BSTR that specifies the application name. Maximum character length is 256.
  • bstrAppURL
    [in] BSTR that specifies the URL from which the application can be downloaded. Maximum character length is 256.
  • bstrPath
    [in] BSTR that specifies the absolute path to the application's executable. Maximum character length is 260.
  • ulFlags
    [in] LONG that specifies the flag. This value should always be 0, otherwise this function returns E_INVALIDARG.

Return Value

Returns one of the following values.

S_OK The application was registered successfully.
E_INVALIDARG One of the parameters passed to the method was not valid.
SR_APP_ALREADY_REGISTERED The application you are registering has already been registered. (See the following Remarks section).
REGDB_E_WRITEREGDB The method failed to write the information to the registry.
E_FAIL The absolute path to the application cannot be resolved or an application with this GUID is already registered.

Remarks

Attempting to register an application with a GUID already registered for use with a Messenger client returns SR_APP_ALREADY_REGISTERED.

After registering an application, if you want to re-register it to update any of its parameters (bstrAppName, bstrAppURL, bstrPath, or ulFlags) except for bstrAppGUID, you need to unregister the application first. For example, if you have an application already registered with bstrAppName set to someFile.exe and the next version of someFile.exe takes command line arguments such as someFile.exe /s, which you want to use with a Messenger client, you must unregister the application before re-registering it, assuming the bstrAppGUID did not change. However, if you specify a different bstrAppGUID that is unique and not in use by any other application, you are not required to unregister the application first.

Important  IMsgrSessionManager::RegisterApplication is no longer available in Windows Vista. See Windows Messenger for more information.

See Also

IMsgrSessionManager::UnRegisterApplication, SESSION_RESULT, Messenger Session Invite and Messenger Private APIs, Messenger Lock and Key API