GetDCOrg

2.x

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

The GetDCOrg function retrieves the coordinates of the final translation origin for the device context. This origin specifies the offset used by Windows to translate device coordinates into client coordinates for points in an application's window. The final translation origin is relative to the physical origin of the screen.

Parameters

hdc

Identifies the device context whose origin is to be retrieved.

Return Value

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

Example

The following example uses the CreateIC function to create an information context for the screen and then retrieves the context's origin by using the GetDCOrg function:

HDC   hdcIC;
DWORD dwOrigin;

hdcIC = CreateIC("DISPLAY", NULL, NULL, NULL);
dwOrigin = GetDCOrg(hdcIC);

DeleteDC(hdcIC);

See Also

CreateIC