Function Reference


_WinAPI_GetPosFromRect

Interprets the coordinates of the rectangle as offset and position coordinates

#include <WinAPIGdi.au3>
_WinAPI_GetPosFromRect ( $tRECT )

Parameters

$tRECT $tagRECT structure that contains the logical coordinates of the rectangle.

Return Value

Success: The array containing the following information:
[0] - The x-coordinate of the upper-left corner of the rectangle.
[1] - The y-coordinate of the upper-left corner of the rectangle.
[2] - The width of the rectangle.
[3] - The height of the rectangle.
Failure: Sets the @error flag to non-zero.

Remarks

This function is inverse to the _WinAPI_CreateRectEx().

Related

_WinAPI_CreateRectEx

Example

#include <WinAPIGdi.au3>

Local $aPos = _WinAPI_GetPosFromRect(_WinAPI_CreateRectEx(10, 10, 100, 100))

ConsoleWrite('Left:   ' & $aPos[0] & @CRLF)
ConsoleWrite('Top:    ' & $aPos[1] & @CRLF)
ConsoleWrite('Width:  ' & $aPos[2] & @CRLF)
ConsoleWrite('Height: ' & $aPos[3] & @CRLF)