Calling the MSN Messenger Client Directly
You can invoke the MSN® Messenger client directly from a Web page by adding script to the Web page. You can start by creating a new HTML page, or you can add script code to an existing HTML page. This script calls an ActiveX® control that invokes the MSN Messenger client application directly. You can design your script to pass two optional string variables to the ActiveX control, or if you prefer, you can pass either of the variables, or none. The variables that are passed to the ActiveX control are the AppID variable and the BOT variable. Both the AppID and the BOT variables are string variables, with the BOT variable being a string in the form of an e-mail address. In the code sample presented below, the BOT variable is assigned the emailID variable name.
The behavior of the MSN Messenger client when it is invoked depends on the following items:
- Which of the two variables you pass to the ActiveX control
- The state of the MSN Messenger client at the time the MSN Messenger ActiveX control is called (whether the MSN Messenger client is active or not)
- Which version of the MSN Messenger client or Microsoft® Internet Explorer browser is installed on the user's system
For more information about the effect of the variables on the behavior of the MSN Messenger client, see Using the MSN Messenger Variables.
The main call that invokes the MSN Messenger ActiveX control is the following in the script area:
However, visitors with versions of Internet Explorer earlier than version 5.01 will not be able to access the MSN Messenger client. Similarly, if their version of the MSN Messenger client is earlier than version 6.2, this method will fail.
For this reason, it is important to add code that verifies the following:
- The visitor is using Internet Explorer 5.01 or later.
- The visitor is using MSN Messenger 6.2 or later.
In the first case, you should add a dialog box that plainly states that visitors' browsers do not support ActiveX controls. In the second case, you should add an error message that provides information that tells visitors that they need a later version of MSN Messenger.
The following sample code (in the script area) illustrates how to programmatically call the ActiveX control that invokes MSN Messenger: