IInkCollector::SetWindowInputRectangle method (msinkaut.h)

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


HRESULT SetWindowInputRectangle(
  [in] IInkRectangle *WindowInputRectangle


[in] WindowInputRectangle

The rectangle, in window coordinates, on which ink is drawn.

Return value

This method can return one of these values.

Return code Description
A parameter contained an invalid pointer.
The rectangle coordinates are invalid (for example, width/height of 0).
Cannot update mappings while in the middle of a stroke.
An exception occurred inside the method.
The window input rectangle overlaps with the window input rectangle of an enabled InkCollector.


The E_INK_OVERLAPPING_INPUT_RECT error is returned if the window input rectangle of an enabled ink collector (set with the Enabled property) overlaps the window input rectangle of another enabled ink collector.

Note  Overlap can occur without an error as long as only one of the input rectangles is enabled at any known time.
By default, the window input rectangle is set to {0,0,0,0}. This default rectangle maps to the size of the entire window.

To reset the window input rectangle to its default behavior (an empty rectangle with coordinates {0,0,0,0}), pass {0,0,0,0} in the call to SetWindowInputRectangle, and not NULL.

You cannot pass in a rectangle where the value of the Right property is less than the value of the Left property; or where the value of the Bottom property is less than the value of the Top property. For example, a rectangle with parameters of {500, 500, 400, 400} is not valid.

Caution  If you set the window input rectangle to overlap a splitter control or the borders of the window, unpredictable results may occur when the window is resized.
Note  Calling this method within certain message handlers can result in the underlying function being re-entered, causing unexpected results. Take care to avoid a reentrant call when handling any of the following messages: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT; WM_SYSCOMMAND if wParam is set to SC_HOTKEY or SC_TASKLIST; and WM_SYSKEYDOWN (when processing Alt+TAB or Alt+ESC key combinations). This is an issue with single-threaded apartment model applications.


Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header msinkaut.h
Library InkObj.dll

See also

Enabled Property

GetWindowInputRectangle Method


InkCollector Class