Indicates that a conversation window has been closed. Scriptable.

Syntax

HRESULT OnIMWindowDestroyed(
   [in] IDispatch* pIMWindow
);

Parameters

pIMWindow

[in] Pointer to an IDispatch interface on the IMessengerConversationWnd object that was destroyed.

Return Value

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

Remarks

It is not permissible to read properties such as HWND from pIMWindow with this event. By the time the local client communicator API application receives the event, the IM window in question has been destroyed. Attempting to read the HWND property of a window that does not exist raises an exception.

Example

The example code illustrates how to handle an IM window destroyed event. The pIMWindow object is not referenced in this code except as a COM object to be released by Marshal.ReleaseComObject().

Copy Code
void communicator_OnIMWindowDestroyed(
	 object pIMWindow)
{
	try
	{
		if (object.ReferenceEquals(pIMWindow, newIMWindow))
		{
			StringBuilder sb = new StringBuilder();
			sb.Append(
			 " IM WINDOW DESTROYED:");
			Console.WriteLine(
					"EVENT: " +
					sb.ToString());
			imWindow = null;
			if (MessWindIntForm != null)
			{
				MessWindIntForm.IMWindow = null;
		}
	}
		Marshal.ReleaseComObject(pIMWindow);
}
	catch (NullReferenceException)
	{
		Console.WriteLine(
			"EVENT: " +
			"Null Reference exception IMWindow Destroyed");
}
}

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