GetWindowExt

2.x

  DWORD GetWindowExt(hdc)    
  HDC hdc; /* handle of device context */

The GetWindowExt function retrieves the x- and y-extents of the window associated with the given device context.

Parameters

hdc

Identifies the device context.

Return Value

The return value specifies the x- and y-extents, in logical units, if the function is successful. The x-extent is in the low-order word; the y-extent is in the high-order word.

Example

The following example uses the GetWindowExt function and the LOWORD and HIWORD macros to retrieve the x- and y-extents of a window:

HDC  hdc;
DWORD dw;
int xWindExt, yWindExt;

hdc = GetDC(hwnd);
dw  = GetWindowExt(hdc);
ReleaseDC(hwnd, hdc);
xWindExt = LOWORD(dw);
yWindExt = HIWORD(dw);

See Also

SetWindowExt