Using the Registration Mechanism
This topic provides basic information about registering a non-Microsoft messenger application.
Windows Messenger supports a mechanism that helps you register your communications application when it is loaded. Windows Messenger can be loaded as an InProc or Local server. See Local vs. InProc Objects in OLE for information on InProc and Local servers.
This topic contains the following sections.
- Steps in Loading Windows Messenger
- Opening Windows Messenger
- Registry Settings
- Calls to Multiple Clients
- Related Topics
When an application loads Windows Messenger, the following actions take place.
- The client checks the registry to determine whether other clients are installed.
- Windows Messenger is set as the primary client on the system, if there are no other clients.
- Microsoft .NET Messenger Service can be disabled if any other client is installed on the system. The Microsoft .NET Messenger Service is disabled only if the previously installed client has the registry flag isDotNetProvider enabled in the registry. If a client has the isDotNetProvider flag set, that client is the Microsoft .NET provider.
In case Windows Messenger is not the .NET provider and does not have the Session Initiation Protocol (SIP) enabled, the Windows Messenger icon in the system tray is deactivated. To open Windows Messenger, use the Windows Messenger executable or open it from the Start Menu. When Windows Messenger opens, an icon is placed in the system tray and the user can click the icon to exit Windows Messenger.
Note If SIP is enabled and two clients are installed, the system tray will contain two icons.
If you write a messenger application you must register your application using the following registry settings.
HKEY_LOCAL_MACHINE Software Microsoft MessengerService Clients My Messenger MessengerGuid = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx MessengerPrivateGuid = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx MsgrSessionManagerGuid = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx isDotNetProvider = dword:00000001
Notice in the preceding registry settings that you must make the following entries.
- My Messenger (your application) is set on the client's key.
- The Messenger GUID entry that implements IMessenger, IMessenger2, and IMessenger3.
Note The format of a GUID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. You must generate your own GUIDs for the three GUID entries.
- The Messenger Private GUID entry that implements IMessengerPrivate.
- The Messenger Session Manager GUID entry that implements IMsgrSessionManager.
- A flag to specify whether the application is a .NET provider.
00000001means true and
All messenger clients must implement the same interfaces as Windows Messenger and the interfaces must respond to the same UUIDs. When a call is made to Windows Messenger, the proxy distributes the call to all installed clients and responds to the calling application by transparently providing a response as if it were one client. For example, if AutoSignin is called the proxy makes a call to AutoSignin on all the clients. When a method call is made to MyContacts the method returns the IDispatch of an object that implements IMessengerContact. This object contains a reference to all the contacts of all the installed clients. All groups, contacts, and services from all clients are wrapped before sending them to the application. The application unwraps them before the proxy calls any of the clients. Events are treated the same way as the method calls. They are distributed to all the clients.
Another important aspect of the proxy is the IDispatch::Invoke method call. This call forwards the method call to all the clients on the system without determining if the calls are allowed. It is up to the client to determine if IDispatch::Invoke should be called. Script safety must be implemented on each client and it is up to the client to determine what is scriptable.
When Windows Messenger and another client are running, the other client can disable autosignin. Apply the bitmask 0x00040000 to the 4-byte registry value AppSettings to turn autosignin off. For example, if the current registry setting is 62 03 00 80, changing the value to 62 07 00 80 disables autosignin.
HKEY_CURRENT_USER Software Microsoft MessengerService AppSettings (REG_BINARY)
Build date: 6/30/2010