--- mstools/samples/polydraw/polydraw.c 2018/08/09 18:20:38 1.1.1.1 +++ mstools/samples/polydraw/polydraw.c 2018/08/09 18:21:22 1.1.1.2 @@ -1,6 +1,10 @@ /**************************************************************************\ * polydraw.c -- sample program demonstrating PolyDraw(). * +* Steve Firebaugh +* Microsoft Developer Support +* Copyright (c) 1992 Microsoft Corporation +* * The user is able to place control points on the screen, and then * drag them. The PolyDraw() call is made to dynamically show the * resulting curve. @@ -104,7 +108,7 @@ int APIENTRY WinMain(HINSTANCE hInstance * PolyDraw (hdc, svPoints, svTypes, svNumDown+1); * \**************************************************************************/ -LRESULT MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static HANDLE hPenGrey, hPenLine, hPenpolydraw; static POINT svPoints [MAXPOINTS]; @@ -221,8 +225,8 @@ static int svIndex; PolyDraw (hdc, &svPoints[1], &svTypes[1], svNumDown); /* Change the point to match the new mouse position. */ - svPoints[svIndex].x = LOWORD(lParam); - svPoints[svIndex].y = HIWORD(lParam); + svPoints[svIndex].x = (int)(short)LOWORD(lParam); + svPoints[svIndex].y = (int)(short)HIWORD(lParam); MoveToEx (hdc, svPoints[0].x, svPoints[0].y, NULL); SelectObject(hdc, hPenLine);