Help Center

CWindow.GetControlClientRectmethod

Retrieves the unscaled coordinates of a window's client area.

WindowsmethodCWindow.incdocumented

Syntax

SUB GetControlClientRect (BYVAL hwnd AS HWND, BYVAL lpRect AS LPRECT)
FUNCTION GetControlClientRect (BYVAL hwnd AS HWND) AS RECT

Parameters

NameDescription
hwndHandle to the window or control.
lpRectPointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.

Description

Retrieves the unscaled coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

Remarks

In conformance with conventions for the RECT structure, the bottom-right coordinates of the returned rectangle are exclusive. In other words, the pixel at (right, bottom) lies immediately outside the rectangle.

Examples

DIM rc AS RECT pWindow.GetControlClientRect(hCtl, @rc)

DIM rc AS RECT = pWindow.GetControlClientRect(hCtl)

Reference

  • Include file CWindow.inc
  • Defined in AfxNova/CWindow.inc:1220
  • Documented in Windows/Windows GUI/CWindow Class.md
  • Topic: CWindow Class