Gets a pointer to an IMessengerWindow object that is used to control automation properties of the main application window, including dimensions, positioning, and visibility. Scriptable.
Syntax
HRESULT Window( [out, retval] IDispatch** ppMWindow ); |
Parameters
- ppMWindow
-
Return value. Address of a pointer to the IDispatch interface on a MessengerWindow object. This object can now be accessed through its IMessengerWindow interface.
Return Value
Returns one of the following values.
- S_OK
-
Success. See "Remarks".
- E_INVALIDARG
-
The client is not responding.
- E_FAIL
-
The client is not responding.
- RPC_X_NULL_REF_POINTER
-
ppMWindow is a null pointer.
Remarks
This property allows access to an object with the IMessengerWindow interface that is used to implement a number of other common automation properties, including the IMessengerWindow::Height property, the IMessengerWindow::Width property, the IMessengerWindow::Top property, the IMessengerWindow::Left property, and the IMessengerWindow::Show method.
Example
The code in this example uses an IMessenger object called communicator. If communicator is not null, the example code declares an ImessengerWindow object called messengerWindow. Getting the Window property on the communicator object returns an object that is cast to an ImessengerWindow object with all of the methods associated. The windows handle property (HWND) is gotten and displayed on the console window.
Copy Code | |
---|---|
if (communicator != null) { IMessengerWindow messengerWindow; try { messengerWindow = (IMessengerWindow)communicator.Window; Console.WriteLine("Window HWND: " + messengerWindow.HWND.ToString()); } catch (COMException GWCE) { Console.WriteLine(GWCE.ErrorCode.ErrorCode()); } } |
Requirements
Type | Description |
---|---|
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 |