title: Visual studio wont work with "MoveTo" (win32api)
body: <p>Here's the code below, VS said that on 
  <strong>line 109 ( MoveTo(hdc, x, y);</strong><br>
  <em>"MoveTo" is undefined</em>. </p>
  
  <p>Can someone explain me what's wrong ? 
  This is a win32api application.</p>
  
  <pre><code>// Win32Project.cpp : Defines the entry point for the application.
  //
  
  #include "stdafx.h"
  #include "Win32Project4.h"
  #include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
  LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  int pNum = 0;
  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
  {
      const WCHAR szAppName[] = L"Third_LAB";
      const WCHAR szChildClass[] = L"Child";
  
      HWND hwnd;
      MSG msg;
      WNDCLASSEX wndclass;
      wndclass.cbSize = sizeof(wndclass);
      wndclass.style = CS_HREDRAW | CS_VREDRAW;
      wndclass.lpfnWndProc = WndProc;
      wndclass.cbClsExtra = 0;
      wndclass.cbWndExtra = 0;
      wndclass.hInstance = hInstance;
      wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
      wndclass.hCursor = LoadCursor(NULL, IDC_CROSS);
      wndclass.hbrBackground = (HBRUSH)(NULL_BRUSH);
      wndclass.lpszMenuName = NULL;
      wndclass.lpszClassName = szAppName;
      wndclass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SMALL));
      RegisterClassEx(&amp;wndclass);
      wndclass.lpfnWndProc = ChildWndProc;
      wndclass.cbWndExtra = sizeof(WORD);
      wndclass.hIcon = NULL;
      wndclass.lpszClassName = szChildClass;
      wndclass.hIconSm = NULL;
      RegisterClassEx(&amp;wndclass);
      hwnd = CreateWindowEx(
          0,
          szAppName, // window class name
          L"Third_LAB", // window caption
          WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL, // window style
          200, // initial x position
          150, // initial y position
          800, // initial x size
          500, // initial y size
          NULL, // parent window handle
          NULL, // window menu handle
          hInstance, // program instance handle
          NULL
      ); // creation parameters
      ShowWindow(hwnd, iCmdShow);
      UpdateWindow(hwnd);
  
      while (GetMessage(&amp;msg, 0, 0, 0))
          DispatchMessage(&amp;msg);
  
  
      return msg.wParam;
  }
  
  LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
  {
      {
          const WCHAR szChildClass[] = L"Child";
          static int cxBlock, cyBlock;
          static HDC hdc;
          static HPEN hPen;
          static BOOL track = FALSE;
          static HWND hwndCH;
          static  int x, y;
  
          switch (iMsg) {
          case WM_CREATE:
              hdc = GetDC(hwnd);
  
              hwndCH = CreateWindow(szChildClass, NULL,
                  WS_CHILDWINDOW | WS_VISIBLE,
                  0, 0, cxBlock / 2 + 3, cyBlock + 3,
                  hwnd, NULL,
                  (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
                  NULL);
              MoveWindow(hwndCH, 0, 0, cxBlock / 2 + 3, cyBlock + 3, NULL);
              return 0;
  
          case WM_SIZE:
  
              cxBlock = LOWORD(lParam);
              cyBlock = HIWORD(lParam);
              MoveWindow(hwndCH, 0, 0, cxBlock / 2 + 3, cyBlock + 3, NULL);
              return 0;
  
          case WM_KEYDOWN:
              switch (wParam)
              {
              case (0x51):
                  PostQuitMessage(0);
                  break;
              }
              return 0;
          case WM_LBUTTONDOWN:
              track = TRUE;
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              MoveTo(hdc, x, y);
              switch (pNum)
              {
              case (1):
                  hPen = CreatePen(PS_SOLID, 5, 0);
                  SelectObject(hdc, hPen); break;
              case (2):
                  hPen = CreatePen(PS_SOLID, 15, 0);
                  SelectObject(hdc, hPen); break;
              case (3):
                  hPen = CreatePen(PS_SOLID, 25, 0);
                  SelectObject(hdc, hPen); break;
              }
              return 0;
          case WM_LBUTTONUP:
              track = FALSE;
              DeleteObject(hPen);
              return 0;
          case WM_MOUSEMOVE:
              if (track)
              {
                  x = LOWORD(lParam);
                  y = HIWORD(lParam);
                  LineTo(hdc, x, y);
                  MoveTo(hdc, x, y);
              }
              return 0;
          case WM_DESTROY:
              ReleaseDC(hwnd, hdc);
  
              PostQuitMessage(0);
              return 0;
          }
          return DefWindowProc(hwnd, iMsg, wParam, lParam);
      }
  }
  LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
  {
      static HDC hdc;
      PAINTSTRUCT ps;
      static int cxBlock, cyBlock;
      static int x, y;
      static HPEN hPen;
      switch (iMsg)
      {
  
      case WM_SIZE:
          hdc = GetDC(hwnd);
          cxBlock = LOWORD(lParam);
          cyBlock = HIWORD(lParam);
          InvalidateRect(hwnd, NULL, TRUE);
          ReleaseDC(hwnd, hdc);
          return 0;
  
      case WM_PAINT:
          hdc = BeginPaint(hwnd, &amp;ps);
          SetROP2(hdc, R2_BLACK);
          Rectangle(hdc, 0, cyBlock / 2 - 100, cxBlock, cyBlock / 2 - 105);
          Rectangle(hdc, 0, cyBlock / 2, cxBlock, cyBlock / 2 - 15);
          Rectangle(hdc, 0, cyBlock / 2 + 100, cxBlock, cyBlock / 2 + 125);
          InvalidateRect(hwnd, NULL, FALSE);
          break;
      case WM_RBUTTONDOWN:
          x = LOWORD(lParam);
          y = HIWORD(lParam);
  
          if ((y &lt;= (cyBlock / 2 - 100)) &amp;&amp; (y &gt;= (cyBlock / 2 - 105)))
              pNum = 1;
          else if ((y &lt;= (cyBlock / 2)) &amp;&amp; (y &gt;= (cyBlock / 2 - 15)))
              pNum = 2;
          else if ((y &gt;= (cyBlock / 2 + 100)) &amp;&amp; (y &lt;= (cyBlock / 2 + 125)))
              pNum = 3;
          return 0;
      case WM_DESTROY:
          DeleteObject(hPen);
          ReleaseDC(hwnd, hdc);
          DestroyWindow(hwnd);
          return 0;
      }
      return DefWindowProc(hwnd, iMsg, wParam, lParam);
  </code></pre>
  
  <p>Waiting for a fast response, I would be very glad. </p>