Sets or retrieves the vertical position of a messenger window relative to the screen, in pixels. Not scriptable.

Syntax

HRESULT Top(
   [out,
   retval] LONG* plTop
);

Parameters

plTop

Pointer to a variable of type LONG that receives the vertical screen position of the top edge of the window, in pixels.

Return Value

Returns one of the following values. For managed code applications, these return values are received in the form of a COMException.

S_OK

Success.

RPC_X_NULL_REF_POINTER

plTop is a null pointer.

E_FAIL

The application window or conversation window was closed either through user action or the method that opened the window.

E_NOTIMPL

The property cannot be accessed through scripting.

Remarks

If the messenger window is minimized, the value retrieved is a seemingly out-of-range value (>= -32000). This behavior is fairly common in Office Communication Automation API. If the window is closed through API or user action, this method fails to get a value and returns E_FAIL.

If this method is called on the IMessengerWindow interface of the parent application's messenger window, it returns the top screen position value of the parent application window.

Example

This code example takes the value of a NumericUpDown form control that contains a decimal number in the Value property, converts that value to an int32, and sets the Top property of the Office Communicator UI. The messengerWindow object is an implementation of the ImessengerWindow interface.

The second example reads the Top property of the messengerWindow and displays the value in a console window.

Copy Code
//SET messengerWindow.Top property
try
{
   messengerWindow.Top = Convert.ToInt32(windowDimensionSpin.Value);
 }
catch (COMException CMET)
{
   Console.WriteLine(CMET.ErrorCode.ToString());
}

//GET messengerWindow.Top property
try
{
   Console.WriteLine("Messenger Window Top:" + messengerWindow.Top.ToString();
 }
catch (COMException CMET)
{
   Console.WriteLine(CMET.ErrorCode.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

IMessengerWindow