--- mstools/samples/multipad/mpinit.c 2018/08/09 18:20:01 1.1.1.1 +++ mstools/samples/multipad/mpinit.c 2018/08/09 18:23:39 1.1.1.2 @@ -1,17 +1,28 @@ +/******************************************************************************\ +* 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. +\******************************************************************************/ + + /*************************************************************************** - * * - * MODULE : MpInit.c * - * * - * PURPOSE : Contains initialization code for MultiPad. * - * * - * FUNCTIONS : InitializeApplication() - Sets up Class data structure * - * and registers window class. * - * * - * InitializeInstance () - Does a per-instance initial- * - * ization of MultiPad. Creates * - * the "frame" and MDI client. * - * * + * * + * MODULE : MpInit.c * + * * + * PURPOSE : Contains initialization code for MultiPad. * + * * + * FUNCTIONS : InitializeApplication() - Sets up Class data structure * + * and registers window class. * + * * + * InitializeInstance () - Does a per-instance initial- * + * ization of MultiPad. Creates * + * the "frame" and MDI client. * + * * ***************************************************************************/ #include "multipad.h" @@ -19,90 +30,90 @@ CHAR szFrame[] = "mpframe"; /* Class n CHAR szChild[] = "mpchild"; /* Class name for MDI window */ /**************************************************************************** - * * - * FUNCTION : InitializeApplication () * - * * - * PURPOSE : Sets up the class data structures and does a one-time * - * initialization of the app by registering the window classes* - * * + * * + * FUNCTION : InitializeApplication () * + * * + * PURPOSE : Sets up the class data structures and does a one-time * + * initialization of the app by registering the window classes* + * * * RETURNS : TRUE - If RegisterClass() was successful for both classes.* - * FALSE - otherwise. * - * * + * FALSE - otherwise. * + * * ****************************************************************************/ BOOL APIENTRY InitializeApplication() { - WNDCLASS wc; + WNDCLASS wc; /* Register the frame class */ - wc.style = 0; + wc.style = 0; wc.lpfnWndProc = (WNDPROC) MPFrameWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInst; - wc.hIcon = LoadIcon(hInst,IDMULTIPAD); - wc.hCursor = LoadCursor(NULL,IDC_ARROW); + wc.hIcon = LoadIcon(hInst,IDMULTIPAD); + wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1); wc.lpszMenuName = IDMULTIPAD; wc.lpszClassName = szFrame; if (!RegisterClass (&wc) ) - return FALSE; + return FALSE; /* Register the MDI child class */ wc.lpfnWndProc = (WNDPROC) MPMDIChildWndProc; - wc.hIcon = LoadIcon(hInst,IDNOTE); + wc.hIcon = LoadIcon(hInst,IDNOTE); wc.lpszMenuName = NULL; wc.cbWndExtra = CBWNDEXTRA; wc.lpszClassName = szChild; if (!RegisterClass(&wc)) - return FALSE; + return FALSE; return TRUE; } /**************************************************************************** - * * - * FUNCTION : InitializeInstance () * - * * + * * + * FUNCTION : InitializeInstance () * + * * * PURPOSE : Performs a per-instance initialization of MultiPad. It * - * also creates the frame and an MDI window. * - * * - * RETURNS : TRUE - If initialization was successful. * - * FALSE - otherwise. * - * * + * also creates the frame and an MDI window. * + * * + * RETURNS : TRUE - If initialization was successful. * + * FALSE - otherwise. * + * * ****************************************************************************/ BOOL APIENTRY InitializeInstance(LPSTR lpCmdLine, INT nCmdShow) { extern HWND hwndMDIClient; - CHAR sz[80], *pCmdLine; - HDC hdc; - HMENU hmenu; + CHAR sz[80], *pCmdLine; + HDC hdc; + HMENU hmenu; /* Get the base window title */ LoadString (hInst, IDS_APPNAME, sz, sizeof(sz)); /* Create the frame */ hwndFrame = CreateWindow (szFrame, - sz, - WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, - CW_USEDEFAULT, - 0, - CW_USEDEFAULT, - 0, - NULL, - NULL, - hInst, - NULL); + sz, + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, + CW_USEDEFAULT, + 0, + CW_USEDEFAULT, + 0, + NULL, + NULL, + hInst, + NULL); if ((!hwndFrame) || (!hwndMDIClient)) - return FALSE; + return FALSE; /* Load main menu accelerators */ if (!(hAccel = LoadAccelerators (hInst, IDMULTIPAD))) - return FALSE; + return FALSE; /* Display the frame window */ ShowWindow (hwndFrame, nCmdShow); @@ -112,7 +123,7 @@ BOOL APIENTRY InitializeInstance(LPSTR l ** else copy command line into our data segment */ if ( lpCmdLine && !(*lpCmdLine)) - pCmdLine = NULL; + pCmdLine = NULL; else { pCmdLine = (CHAR *) LocalAlloc(LPTR, lstrlen(lpCmdLine) + 1); if (pCmdLine) @@ -130,7 +141,7 @@ BOOL APIENTRY InitializeInstance(LPSTR l styleDefault = 0L; return TRUE; - UNREFERENCED_PARAMETER(hmenu); - UNREFERENCED_PARAMETER(hdc); + UNREFERENCED_PARAMETER(hmenu); + UNREFERENCED_PARAMETER(hdc); }