GetWindowInputRectangle Method

GetWindowInputRectangle Method

Gets the window rectangle, in pixels, within which ink is drawn.

Declaration

[C++]

HRESULT GetWindowInputRectangle (
    [out] IInkRectangle **windowRectangle
);

[Microsoft® Visual Basic® 6.0]

Public Sub GetWindowInputRectangle( _
    windowRectangle As InkRectangle _
)

Parameters

windowRectangle

[out] Gets the rectangle, of type InkRectangle, on which ink is drawn.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contains an invalid pointer.
REGDB_CLASSNOTREG The InkRectangle object is not registered.
E_INK_EXCEPTION An exception occurs inside the method.

Remarks

You must first allocate the rectangle before passing it on to this method.

By default, the window input rectangle is set to {0,0,0,0}. This default rectangle maps to the size of the entire window.

If you call GetWindowInputRectangle before you call the SetWindowInputRectangle method, this method gets a rectangle with the default coordinates.

Example

[Visual Basic 6.0]

This example gets the window input rectangle of a new InkCollector object, theInkCollector, and reports the resulting rectangle, which defaults to {0,0,0,0} if the value has not been previously set, in the caption of a label, theLabel.

Option Explicit
Dim theInkCollector As InkCollector

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True
    Dim theRect As New InkRectangle
    theInkCollector.GetWindowInputRectangle theRect
    theLabel.Caption = "Window left: " & theRect.Left & _
        " top: " & theRect.Top & _
        " right: " & theRect.Right & _
        " bottom: " & theRect.Bottom
End Sub

Applies To