IMessengerWindow::Width
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 horizontal dimension of a messenger window, in pixels. Not scriptable.
Syntax
HRESULT Width(
[out,
retval] LONG* plWidth
);
Parameters
- plWidth
Pointer to a variable of type LONG that receives the width 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
plWidth is a null pointer.
- E_INVALIDARG
You attempted to set window to zero or a negative width.
- E_FAIL
Cannot get a window handle.
- E_NOTIMPL
The property cannot be accessed through scripting.
Remarks
If the window is closed (only available from the Taskbar) or not responding, or if the HWND could not be found, this method fails.
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 Width property of the Office Communicator UI. The messengerWindow object is an implementation of the ImessengerWindow interface.
The second example reads the Width property of the messengerWindow and displays the value in a console window.
//SET messengerWindow.Width property
try
{
messengerWindow.Width = Convert.ToInt32(windowDimensionSpin.Value); }
catch (COMException CMEW)
{
Console.WriteLine(CMEW.ErrorCode.ToString());
}
//GET messengerWindow.Width property
try
{
Console.WriteLine("Messenger Window Width:" + messengerWindow.Width.ToString();
}
catch (COMException CMEW)
{
Console.WriteLine(CMEW.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