Indicates that a new conversation window has been opened. Scriptable.

Syntax

HRESULT OnIMWindowCreated(
   [in] IDispatch* pIMWindow
);

Parameters

pIMWindow

[in] Pointer to an IDispatch interface on the IMessengerConversationWnd object that corresponds to the newly created conversation window.

Return Value

The implementer of this event handler will determine what value should be returned.

Remarks

To support IM functionality, a local client implementing Office Communicator Automation API must use a conversation window created by the supplied automation assembly. In order to control the appearance of the IM window and the list of participating users, the custom application must handle this asynchronous event. When a local application makes a request to start a conversation by calling the IMessenger::InstantMessage, an IMessengerConversationWnd object is returned.

The application can open and interact with multiple IM windows concurrently. All IM window related event arguments include a pIMWindow object which can be compared to currently opened IM windows using the object.ReferenceEquals(object, object) method to determine which IM window generated the event.

Example

This event handler references a protected class member, IMessengerConversationWnd (imWindow). Memory is allocated for the imWindow object when it is declared and instantiated by a call to the IMessenger::InstantMessage method elsewhere in the example application. The event handler in this example will display the HWND value of the created IM window.

Copy Code
public partial class OC_API_tester : Form
{
   protected IMessengerConversationWnd  imWindow;
   ... // class methods
   void communicator_OnIMWindowCreated(object pIMWindow)
   {
	 if (object.ReferenceEquals(pIMWindow, imWindow))
	 {
		 StringBuilder sb = new StringBuilder();
		 sb.Append(
			 " IM WINDOW CREATED: window handle-" +
			imWindow.HWND);

		 Console.WriteLine(
			 "EVENT: " +
			 sb.ToString());
	 }
   }
}


Requirements

Client

Requires Microsoft DirectX 9.0, C Runtime libraries (msvcm80.dll) on Microsoft Windows© Vista, Microsoft Windows XP Service Pack 1 (SP1) or later, or Microsoft Windows 2000 with Service Pack 4 (SP4). Any Communicator-imposed restrictions apply. .

Server

Requires Microsoft Office Communications Server 2007, AV MCU (for Media Support), Media Relay (for NAT/Firewall traversal) on Microsoft Office Communications Server 2007.

Product

Microsoft Office Communicator 2007 Automation API

IDL file

Msgrua.idl

See Also

Reference

DMessengerEvents