--- mstools/samples/wxform/wxform.c 2018/08/09 18:21:41 1.1.1.2 +++ mstools/samples/wxform/wxform.c 2018/08/09 18:23:44 1.1.1.3 @@ -1,10 +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. +\******************************************************************************/ + /**************************************************************************\ * wxform.c -- sample program demonstrating the new "World Transform." * -* Steve Firebaugh -* Microsoft Developer Support -* Copyright (c) 1992 Microsoft Corporation -* * design: There are a few global handles or pointers in this application, * and different routines to operate on them. The obvious case of this * is the three window handles and their associated window procedures. @@ -45,7 +52,7 @@ int APIENTRY WinMain(HINSTANCE hInstance if (!hPrevInstance) { WNDCLASS wc; - wc.style = NULL; + wc.style = 0; wc.lpfnWndProc = (WNDPROC)MainWndProc; wc.cbClsExtra = 0; @@ -93,7 +100,7 @@ int APIENTRY WinMain(HINSTANCE hInstance * for this application. */ hwndTransform = CreateDialog(hInst, "TransformDlg", - hwndMain, (DLGPROC)TransformDlgProc); + hwndMain, (DLGPROC)TransformDlgProc); hicon = (HICON) GetClassLong (hwndMain, GCL_HICON); SetClassLong (hwndTransform, GCL_HICON, (LONG)hicon); showTransform = TRUE; @@ -103,7 +110,7 @@ int APIENTRY WinMain(HINSTANCE hInstance * minimize it initially. */ hwndMouse = CreateDialog(hInst, "MouseDlg", - hwndMain, (DLGPROC)MouseDlgProc); + hwndMain, (DLGPROC)MouseDlgProc); ShowWindow (hwndMouse, SW_SHOWMINIMIZED); showMouse = FALSE; @@ -117,12 +124,12 @@ int APIENTRY WinMain(HINSTANCE hInstance /* Loop getting messages and dispatching them. */ - while (GetMessage(&msg,NULL, NULL, NULL)) { + while (GetMessage(&msg,NULL, 0,0)) { if (!IsDialogMessage (hwndTransform, &msg)) if (!IsDialogMessage (hwndMouse, &msg)) if (!IsDialogMessage (hwndHelp, &msg)){ - TranslateMessage(&msg); - DispatchMessage(&msg); + TranslateMessage(&msg); + DispatchMessage(&msg); } } return (msg.wParam); @@ -287,10 +294,8 @@ static HANDLE hPenGrid; break; - default: - return (DefWindowProc(hwnd, message, wParam, lParam)); - } - return (NULL); + } /* end switch */ + return (DefWindowProc(hwnd, message, wParam, lParam)); } @@ -403,7 +408,7 @@ char buffer[MAXCHARS]; // HACK. The WM_SIZE here is used to flush the GDI buffer in order // to eliminate a very strange bug whereby DPtoLP() doesn't work. - if (showMouse) SendMessage (hwndMain, WM_SIZE, NULL, NULL); + if (showMouse) SendMessage (hwndMain, WM_SIZE, 0,0); doTrackObject (ptoRect, TROB_SETXFORM, hwnd, (LONG) &xform); @@ -427,7 +432,7 @@ char buffer[MAXCHARS]; // HACK. The WM_SIZE here is used to flush the GDI buffer in order // to eliminate a very strange bug whereby DPtoLP() doesn't work. - if (showMouse) SendMessage (hwndMain, WM_SIZE, NULL, NULL); + if (showMouse) SendMessage (hwndMain, WM_SIZE, 0,0); doTrackObject (ptoRect, TROB_SETXFORM, hwnd, (LONG) &xform); SendMessage (hwnd, WM_PUTUPFLOATS, 0, (LONG) &xform); @@ -599,6 +604,7 @@ PTrackObject doTrackObject(PTrackObject /* initialize the HDC and other fields. */ pto->hdc = GetDC(hwnd); + SetGraphicsMode (pto->hdc, GM_ADVANCED); SetROP2(pto->hdc, R2_NOT); SelectObject (pto->hdc, GetStockObject (NULL_BRUSH)); SelectObject(pto->hdc, CreatePen (PS_SOLID, 2, (COLORREF) 0x01000009));