Share via


IMessengerWindow::Top property

[Top is no longer available for use as of Windows Vista. See Windows Messenger for more information.]

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

This property is read/write.

Syntax

HRESULT put_Top(
  [in]          LONG lTop
);

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

Property value

Error codes

Returns one of the following values.

Name Meaning
S_OK
Success.
RPC_X_NULL_REF_POINTER
plTop is a NULL pointer.
E_FAIL
Messenger application window or conversation window has been closed either through user action or the method that launched the window.
E_NOTIMPL
Cannot be accessed through scripting.

Remarks

The following table lists error codes returned by this method.

Error Code Meaning
0x80004001 Cannot be accessed through scripting.
0x80004005 Messenger window was invisible or not responding, cannot be moved or resized, or its HWND could not be found.

If the Messenger window is minimized, the value retrieved will be a seemingly out-of-range value (>= -32000). This behavior is fairly common in automation APIs. If the Messenger 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.

Note

This property is not available for scripting languages.

Examples

The following Visual Basic example shows the use of this method.

Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrWindow As MessengerAPI.IMessengerWindow

Private Sub Form_Load()
    Text_Top.Text = CStr(MsgrWindow.Top)
    Text_Height.Text = CStr(MsgrWindow.Height)
    Text_Left.Text = CStr(MsgrWindow.Left)
    Text_Width.Text = CStr(MsgrWindow.Width)
End Sub

Requirements

End of client support
Windows XP
End of server support
Windows Server 2003
Header
Msgrua.h
IDL
Msgrua.idl
DLL
Msgsc.dll