HDC GetDC( HWND hWnd  );
BOOL MoveToEx(
  HDC hdc,          // handle to device context
  int X,            // x-coordinate of new current position
  int Y,            // y-coordinate of new current position
  LPPOINT lpPoint   // old current position
);
BOOL LineTo(
  HDC hdc,    // device context handle
  int nXEnd,  // x-coordinate of ending point
  int nYEnd   // y-coordinate of ending point
);

解决方案 »

  1.   

    ::MoveToEx(dc,x,y,p1);
    ::LineTo(dc,x1,y1);
      

  2.   

    和mfc一样的,你在mouse中处理MoveToEx和LineTO
      

  3.   

    我知道是用这两个函数,可是无论我怎么用,都没成功,最好能给我一个例子,谢谢,顺便说一句,我是在atl的control中的Ondraw中使用
      

  4.   

    创建一个Win32 Application,选中A typical "Hello World!" application,
    修改case WM_PAINT:
    case WM_PAINT:
    hdc = BeginPaint(hWnd, &ps);
    RECT rt;
    GetClientRect(hWnd, &rt);
    //DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
    MoveToEx(hdc,10,10,NULL);
    LineTo(hdc,100,100);
    EndPaint(hWnd, &ps);
    break;运行看看结果