Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[RegisterApplication is no longer available for use as of Windows Vista. See Windows Messenger for more information.]
Registers an application for use with a Messenger client.
Syntax
HRESULT RegisterApplication(
[in] BSTR bstrAppGUID,
[in] BSTR bstrAppName,
[in] BSTR bstrAppURL,
[in] BSTR bstrPath,
[in] LONG ulFlags
);
Parameters
-
bstrAppGUID [in]
-
Type: BSTR
BSTR that specifies the GUID of the application. Maximum character length is 39.
-
bstrAppName [in]
-
Type: BSTR
BSTR that specifies the application name. Maximum character length is 256.
-
bstrAppURL [in]
-
Type: BSTR
BSTR that specifies the URL from which the application can be downloaded. Maximum character length is 256.
-
bstrPath [in]
-
Type: BSTR
BSTR that specifies the absolute path to the application's executable. Maximum character length is 260.
-
ulFlags [in]
-
Type: LONG
LONG that specifies the flag. This value should always be 0, otherwise this function returns E_INVALIDARG.
Return value
Type: HRESULT
Returns one of the following values.
| Return code | Description |
|---|---|
|
The application was registered successfully. |
|
One of the parameters passed to the method was not valid. |
|
The application you are registering has already been registered. (See the following Remarks section). |
|
The method failed to write the information to the registry. |
|
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.
The following table lists the error codes returned by this method.
| Error Code | Meaning |
|---|---|
| 0x80004005 | The session information cannot be retrieved due to a catastrophic error. |
| 0x80070057 | One of the parameters passed to the method was not valid. |
Requirements
| Minimum supported client |
Windows XP [desktop apps only] |
| Minimum supported server |
Windows Server 2003 [desktop apps only] |
| End of client support |
Windows XP |
| End of server support |
Windows Server 2003 |
| Product |
Messenger 4.5 |
| Header |
|
| IDL |
|
| DLL |
|