DWORD GetViewportExt(hdc) | |||||
HDC hdc; | /* handle of device context | */ |
The GetViewportExt function retrieves the x- and y-extents of the device context's viewport.
hdc
Identifies the device context.
The low-order word of the return value contains the x-extent, in device units, if the function is successful; the high-order word contains the y-extent.
The following example uses the GetViewportExt function and the LOWORD and HIWORD macros to retrieve the x- and y-extents for a device context:
HDC hdc;
DWORD dw;
int xViewExt, yViewExt;
hdc = GetDC(hwnd);
dw = GetViewportExt(hdc);
ReleaseDC(hwnd, hdc);
xViewExt = LOWORD(dw);
yViewExt = HIWORD(dw);