Returns the coordinates of the screen that contains a window. Then, you have the ability to manage the positions or the sizes of windows in a single-screen or multi-screen environment. You can for example find out whether a window exceeds the size of the screen or whether the window is centered in the screen.
sRect is string = WinScreenRectangle(WIN_Window1, screenWithoutTaskbar)
nYMax is int = ExtractString(sRect, 4)
Syntax
<Result> = WinScreenRectangle([<Window used> [, <Options>]])
<Result>: Character string
Dimensions of the screen where the window is displayed. These coordinates are returned in the following format:
<X1> + TAB + <Y1> + TAB + <X2> + TAB + <Y2>
- The (X1, Y1) coordinates correspond to the top left corner of the screen.
- The (X2, Y2) coordinates correspond to the bottom right corner of the screen.
If 2 screens are used and if the window is displayed on the second screen, the (X1, Y1) coordinates correspond to the coordinates of the second screen (1280, 0 for example).
<Window used>: Optional window name
Name or alias of the window to be used.
If this parameter is not specified or if it corresponds to an empty string (""), the calling window is used.
The main screen is used if no window is opened.
<Options>: Optional integer constant
Elements taken into account for the size of the screen: | |
screenAll (Default value) | Total size of the screen. |
screenWithoutTaskbar | If the taskbar is active on the screen, its size is subtracted. |