GetViewportOrg

2.x

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

The GetViewportOrg function retrieves the x- and y-coordinates of the origin of the viewport associated with the given device context.

Parameters

hdc

Identifies the device context.

Return Value

The low-order word of the return value contains the viewport origin's x-coordinate, in device coordinates, if the function is successful; the high-order word contains the y-coordinate of the viewport origin.

Example

The following example uses the GetViewportOrg function and the LOWORD and HIWORD macros to retrieve the x- and y-coordinates of the viewport origin:

HDC  hdc;
DWORD dw;
int xViewOrg, yViewOrg;

hdc = GetDC(hwnd);
dw  = GetViewportOrg(hdc);
ReleaseDC(hwnd, hdc);
xViewOrg = LOWORD(dw);
yViewOrg = HIWORD(dw);

See Also

GetWindowOrg, SetViewportOrg