Export (0) Print
Expand All

DMessengerEvents::OnIMWindowDestroyed

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Indicates that a conversation window has been closed. Scriptable.


HRESULT OnIMWindowDestroyed(
   [in] IDispatch* pIMWindow
);

pIMWindow

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

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

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.

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().

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");
    }
}

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

Community Additions

ADD
Show:
© 2014 Microsoft