Indicates that a contact has been removed from the ongoing conversation. Scriptable.

Syntax

HRESULT OnIMWindowContactRemoved(
   [in] IDispatch* pContact,
   [in] IDispatch* pIMWindow
);

Parameters

pContact

[in] Pointer to an IDispatch interface on the IMessengerContact object that corresponds to the added contact.

pIMWindow

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

Return Value

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

Remarks

This event is returned when the Office Communicator server has successfully removed a user from an ongoing conversation. The Office Communicator UI places the removed user in the Recent Contacts group within the UI because of that user's prior interaction with the local client user. The Recent Contacts group contains the last 10 users that have interacted with the local client user. To make the removed user a permanent contact, this event handler should generate a request to the Office Communicator server to add this user as a permanent contact to the local client contact list. See IMessenger::AddContact for more information.

Note: The pContact parameter is cast to the IMessengerContact interface to gain access to the properties necessary to do work. This contact represents a temporary interaction with another user within an IM conversation. This IMessengerContact user object might not be a member of the local client user's contact list. Using the IMessengerContacts collection, an application can determine that the user is not a member of the local client user's contact list.

Example

The event handler displays the HWND of the IM window opened for a conversation and the friendly name of the contact removed from the conversation. The two parameters of this event handler must be cast to appropriate interfaces to access the properties needed to display the values in the application console window.

Copy Code
void communicator_OnIMWindowContactRemoved(
	 object pContact, 
	 object pIMWindow)
{
	IMessengerWindow imWindow = (IMessengerWindow)pIMWindow;
	IMessengerContact imContact = (IMessengerContact)pContact;
	StringBuilder sb = new StringBuilder();
	sb.Append(
	 " IM CONTACT REMOVED: window handle-" + 
	 imWindow.HWND);

	sb.Append(
	 " Contact:" + 
	 imContact.FriendlyName);

	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