Share via


IMessengerWindow::Left

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.

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

Syntax

HRESULT Left(
   [out,
   retval] LONG* plLeft
);

Parameters

  • plLeft
    Pointer to a variable of type LONG that receives the screen position of the left edge of the messenger 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
    plLeft is a null pointer.
  • E_FAIL
    Cannot get a window handle.
  • E_NOTIMPL
    The property cannot be accessed through scripting.

Remarks

If the messenger window is minimized, the value retrieved appears to be out of range (>= -32000). If the messenger window is closed through the API or user action, this method returns the left position of the window when it is opened again.

If this method called on the MessengerWindow object of the parent application's messenger window, it returns the left screen position value of the parent application window.

There is no bounds-checking on input values for plLeft. Negative integer values are accepted, but the window goes no further off the left side than half its width.

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 Left property of the Office Communicator UI. The messengerWindow object is an implementation of the IMessengerWindow interface.

The left edge of the messengerWindow is moved to the screen coordinate specified by the Left property. The Top property has been set to zero to set the messengerWindow to the top of the screen. If both the Top and Left properties are set to zero, the messengerWindow is positioned in the top left corner of the screen.

//SET messengerWindow.Left property
try
{
    messengerWindow.Left = Convert.ToInt32(windowDimensionSpin.Value);
    messengerWindow.Top = 0;
}
catch (COMException CMEL)
{
   Console.WriteLine(CMEL.ErrorCode.ToString());
}

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