MoveTo

2.x

  DWORD MoveTo(hdc, nXPos, nYPos)    
  HDC hdc; /* handle of device context */
  int nXPos; /* x-coordinate of new position */
  int nYPos; /* y-coordinate of new position */

The MoveTo function moves the current position to the specified coordinates.

Parameters

hdc

Identifies the device context.

nXPos

Specifies the logical x-coordinate of the new position.

nYPos

Specifies the logical y-coordinate of the new position.

Return Value

The low-order word of the return value contains the logical x-coordinate of the previous position, if the function is successful; the high-order word contains the logical y-coordinate.

Example

The following example uses the MoveTo function to set the current position and then calls the LineTo function. The example uses POINT structures to store the coordinates.

HDC hdc;

POINT ptStart = {  12,  12 };
POINT ptEnd = { 128, 135 };

MoveTo(hdc, ptStart.x, ptStart.y);
LineTo(hdc, ptEnd.x, ptEnd.y);

See Also

GetCurrentPosition, LineTo