DWORD GetWindowOrg(hdc) | |||||
HDC hdc; | /* handle of device context | */ |
The GetWindowOrg function retrieves the x- and y-coordinates of the origin of the window associated with the given device context.
hdc
Identifies the device context.
The low-order word of the return value contains the logical x-coordinate of the window's origin, if the function is successful; the high-order word contains the y-coordinate.
The following example uses the GetWindowOrg function and the LOWORD and HIWORD macros to retrieve the x- and y-coordinates for the window origin:
HDC hdc;
DWORD dw;
int xWindOrg, yWindOrg;
hdc = GetDC(hwnd);
dw = GetWindowOrg(hdc);
ReleaseDC(hwnd, hdc);
xWindOrg = LOWORD(dw);
yWindOrg = HIWORD(dw);