--- q_a/samples/subclass/subclass.c 2018/08/09 18:29:19 1.1.1.1 +++ q_a/samples/subclass/subclass.c 2018/08/09 18:29:42 1.1.1.2 @@ -1,8 +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. +\******************************************************************************/ + /**************************************************************************\ * subclass.c -- Demonstrate subclassing of standard controls. * -* written March 92 by Steve Firebaugh -* * This sample allows the user to create an arbitrary number of child * controls on the main window. These controls are subclassed, and the * subclass procedure provides the user a way to move and size the controls. @@ -48,7 +57,7 @@ * input parameters: c.f. generic sample * \**************************************************************************/ -int APIENTRY WinMain(HANDLE hInstance, HANDLE hPrevInstance, +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; @@ -60,7 +69,7 @@ int APIENTRY WinMain(HANDLE hInstance, H if (!hPrevInstance) { WNDCLASS wc; - wc.style = NULL; + wc.style = 0; wc.lpfnWndProc = (WNDPROC)MainWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; @@ -97,7 +106,7 @@ int APIENTRY WinMain(HANDLE hInstance, H ShowWindow(hwndMain, nCmdShow); /* Loop getting messages and dispatching them. */ - while (GetMessage(&msg,NULL, NULL, NULL)) { + while (GetMessage(&msg,NULL, 0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } @@ -186,10 +195,8 @@ HWND hwndChild; } /* end switch */ } break; /* end WM_COMMAND */ - default: - return (DefWindowProc(hwnd, message, wParam, lParam)); } - return (NULL); + return (DefWindowProc(hwnd, message, wParam, lParam)); }