GetChildRect method


Available for all objects.

Prototype

GetChildRect Proto hWnd:HWND, lpRect:DWord

Syntax

Invoke GetChildRect, hWnd, lpRect

Function

Retrieves the dimensions of the bounding rectangle for the specified object.

Parameters

hWnd

Handle to the object.

lpRect

Pointer to the address of a RECT structure that receives the bounding rectangle.

Return value

Eax/Rax returns TRUE if successful, or FALSE if not.


Possible returned values are:

TRUE     The RECT structure pointed by lpRect is filled with the object dimensions.
FALSE   hWnd is not a valid handle.


REMARKS: If the object is a child control or an MDI child window, the coordinates of the object (left and top members of the RECT structure) are relative to its parent client area. If the object has no parent (window objects), then the coordinates are relative to the screen.

IMPORTANT: The dimensions of the bounding rectangle are retrieved in Pixels o Twips depending on the ScaleMode property of the owner window o Picture object containing the child control. If the parent of the child control is a DialogBox object, the dimensions are always retrieved in Pixels.