Admin Production ni-theme
Current Publication

GetMonitorFromRect

LabWindows/CVI

GetMonitorFromRect

int GetMonitorFromRect (Rect rectangle, int *monitorID);

Purpose

Returns the ID of the monitor that contains the specified rectangle or is nearest to the specified rectangle.

If the rectangle is on more than one monitor, the function returns the monitor that contains the majority of the rectangle.

Parameters

Input
Name Type Description
rectangle Rect A Rect structure.

The Rect structure is defined as follows:

typedef struct
   {
   int top;
   int left;
   int height;
   int width;
   } Rect;


You can create a Rect without having to declare a variable by using the following function:

Rect MakeRect (int top, int left, int height, int width);

Output
Name Type Description
monitorID int The ID of the monitor that contains the majority of the specified rectangle or is nearest to the specified rectangle.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later