--- mstools/samples/gdidemo/poly.c 2018/08/09 18:21:45 1.1.1.2 +++ mstools/samples/gdidemo/poly.c 2018/08/09 18:23:49 1.1.1.3 @@ -1,12 +1,17 @@ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + /*---------------------------------------------------------------------------*\ | POLYBEZIER MODULE | This module contains the routines for demo -| -| segment: _TEXT (DOS16) -| created: 19-Oct-90 -| history: 19-Oct-90 created original polybezier effect. -| 20-May-91 adapted for use in MDI application. -| \*---------------------------------------------------------------------------*/ #include @@ -16,10 +21,6 @@ /*---------------------------------------------------------------------------*\ | CREATE BEZIER WINDOW PROCEDURE | Create the bezier MDI-child window. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ HWND FAR CreatePolyWindow(HWND hWndClient, int nItem) { @@ -35,25 +36,21 @@ HWND FAR CreatePolyWindow(HWND hWndClien */ mcs.szClass = POLYCLASS; mcs.szTitle = POLYTITLE; - mcs.hOwner = hInstance; + mcs.hOwner = hInstance; mcs.x = CW_USEDEFAULT; mcs.y = CW_USEDEFAULT; mcs.cx = CW_USEDEFAULT; mcs.cy = CW_USEDEFAULT; - mcs.style = 0l; + mcs.style = 0l; mcs.lParam = (LONG)nItem; - return((HWND)SendMessage(hWndClient,WM_MDICREATE,NULL,(LONG)(LPMDICREATESTRUCT)&mcs)); + return((HWND)SendMessage(hWndClient,WM_MDICREATE,0,(LONG)(LPMDICREATESTRUCT)&mcs)); } /*---------------------------------------------------------------------------*\ | POLYBEZIER WINDOW PROCEDURE | This is the main window function for the polybezier demo window. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ LONG APIENTRY PolyProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam) { @@ -100,10 +97,6 @@ LONG APIENTRY PolyProc(HWND hWnd, UINT w | Create the polybezier window for the demo application. This is a child | of the MDI client window. Allocate the extra object information for | handling of the polybezier demo. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ BOOL PolyCreateProc(HWND hWnd) { @@ -136,10 +129,6 @@ BOOL PolyCreateProc(HWND hWnd) | POLYBEZIER COMMAND PROCEDURE | Process polybezier commands. This is a NOP for now. But who knows what | tomorrow may bring. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ BOOL PolyCommandProc(HWND hWnd, WPARAM wParam, LONG lParam) { @@ -155,10 +144,6 @@ BOOL PolyCommandProc(HWND hWnd, WPARAM w | POLYBEZIER PAINT PROCEDURE | Repaint the bezier window. All we really do here is validate our window, | and reset the array of bezier objects. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ VOID PolyPaintProc(HWND hWnd) { @@ -179,10 +164,6 @@ VOID PolyPaintProc(HWND hWnd) | POLYBEZIER DESTROY PROCEDURE | Kill the polybezier demo. Free up the resources allocated on behalf of | this object. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ VOID PolyDestroyProc(HWND hWnd) { @@ -206,10 +187,6 @@ VOID PolyDestroyProc(HWND hWnd) | This routine creates a new velocity for the bezier points. Each bezier | point is randomly chosen. The two inside points should have a speed | less then the endpoints (most of the time-better effect). -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ int PolyNewVel(int i) { @@ -229,10 +206,6 @@ int PolyNewVel(int i) | INITIALIZE POLYBEZIER POINTS | This routine initializes the polybezier points for the first object. This | is performed on startup of the window. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ VOID PolyInitPoints(HWND hWnd) { @@ -268,10 +241,6 @@ VOID PolyInitPoints(HWND hWnd) | POLYBEZIER REDRAW | This routine resets the bezier curves and redraws the poly-bezier client | area. -| -| created: 20-May-91 -| history: 20-May-91 created. -| \*---------------------------------------------------------------------------*/ VOID PolyRedraw(HWND hWnd) { @@ -322,7 +291,7 @@ VOID PolyRedraw(HWND hWnd) /* ** Draw the first curve in the bezier array. */ -#ifdef WIN32 +#if defined(_WIN32) && defined(WIN32) PolyBezier(hDC,lpBez->pPts,BEZ_PTS); #else Polyline(hDC,lpBez->pPts,BEZ_PTS); @@ -378,7 +347,7 @@ static COLORREF crColor[] = {0x000000FF, if(lpCurr->pPts[0].x != -1) { hPen = SelectObject(hDC,GetStockObject(BLACK_PEN)); -#ifdef WIN32 +#if defined(_WIN32) && defined(WIN32) PolyBezier(hDC,lpCurr->pPts,BEZ_PTS); #else Polyline(hDC,lpCurr->pPts,BEZ_PTS); @@ -423,14 +392,14 @@ static COLORREF crColor[] = {0x000000FF, } hPen = SelectObject(hDC,CreatePen(PS_SOLID,1,crColor[ppd->nColor])); -#ifdef WIN32 +#if defined(_WIN32) && defined(WIN32) PolyBezier(hDC,lpCurr->pPts,BEZ_PTS); #else Polyline(hDC,lpCurr->pPts,BEZ_PTS); #endif DeleteObject(SelectObject(hDC,hPen)); -#ifdef WIN32 +#if defined(_WIN32) && defined(WIN32) SetROP2(hDC,R2_COPYPEN); #endif ReleaseDC(hWnd,hDC);