--- q_a/samples/streblt/streblt.c 2018/08/09 18:29:19 1.1 +++ q_a/samples/streblt/streblt.c 2018/08/09 18:29:46 1.1.1.3 @@ -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. +\******************************************************************************/ + /**************************************************************************\ * streblt.c -- sample program demonstrating StretchBlt() * -* written Feb 92 by Steve Firebaugh -* * design: There is one main window with one dialog box streblted to fill * the top of it. The parameters for the StretchBlt() are stored in the * entry fields of this dialog box. The user may change these values and @@ -45,7 +54,7 @@ int iPatternBrush = NONE; * 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; @@ -59,7 +68,7 @@ int APIENTRY WinMain(HANDLE hInstance, H if (!hPrevInstance) { WNDCLASS wc; - wc.style = NULL; + wc.style = 0; wc.lpfnWndProc = (WNDPROC)MainWndProc; wc.cbClsExtra = 0; @@ -95,7 +104,7 @@ int APIENTRY WinMain(HANDLE hInstance, H /* create the top dialog as a child of the main window. */ - hwndDlg = CreateDialog (hInst, "strebltDlg", hwndMain, (WNDPROC)DlgProc); + hwndDlg = CreateDialog (hInst, "strebltDlg", hwndMain, (DLGPROC)DlgProc); /* Send main window a WM_SIZE message so that it will size the top * dialog correctly. Also, force a repaint of the main window @@ -112,14 +121,14 @@ int APIENTRY WinMain(HANDLE hInstance, H /* Loop getting messages and dispatching them. */ - while (GetMessage(&msg,NULL, NULL, NULL)) { + while (GetMessage(&msg,NULL, 0,0)) { if (!TranslateAccelerator(hwndMain, haccel, &msg)) if (!IsDialogMessage (hwndDlg, &msg)) { DispatchMessage(&msg); } } - return (msg.wParam); /* Returns the value from PostQuitMessage */ + return (msg.wParam); /* Returns the value from PostQuitMessage */ } @@ -170,8 +179,8 @@ static HANDLE hPenGrid, hPenSeparator; hdcSrc = GetDC (hwnd); hdcDest = GetDC (hwnd); - ptoDest = doTrackObject (NULL, TROB_NEW, hwnd,NULL); - ptoSrc = doTrackObject (NULL, TROB_NEW, hwnd,NULL); + ptoDest = doTrackObject (NULL, TROB_NEW, hwnd,0); + ptoSrc = doTrackObject (NULL, TROB_NEW, hwnd,0); hPenGrid = CreatePen (PS_SOLID, 1, GRIDCOLOR); hPenSeparator = CreatePen (PS_SOLID, 2*SEPARATORWIDTH, (COLORREF) 0x01000000); @@ -187,8 +196,8 @@ static HANDLE hPenGrid, hPenSeparator; case WM_DESTROY: ReleaseDC (hwnd, hdcSrc ); ReleaseDC (hwnd, hdcDest); - doTrackObject (ptoDest, TROB_DELETE, hwnd,NULL); - doTrackObject (ptoSrc , TROB_DELETE, hwnd,NULL); + doTrackObject (ptoDest, TROB_DELETE, hwnd,0); + doTrackObject (ptoSrc , TROB_DELETE, hwnd,0); DeleteObject(hPenGrid); DeleteObject(hPenSeparator); @@ -208,7 +217,7 @@ static HANDLE hPenGrid, hPenSeparator; case WM_SIZE: { HRGN hrgn; - SetWindowPos (hwndDlg, NULL, 0,0, LOWORD(lParam), DIALOGHEIGHT, NULL); + SetWindowPos (hwndDlg, NULL, 0,0, LOWORD(lParam), DIALOGHEIGHT, 0); GetClientRect (hwndMain, &rect); miniWidth = rect.right/2; @@ -276,7 +285,7 @@ static HANDLE hPenGrid, hPenSeparator; if (hbmSrc) DrawBitmap (hdcSrc, hbmSrc); /* paint the source track object on top of the bitmap */ - doTrackObject (ptoSrc , TROB_PAINT, hwnd, NULL); + doTrackObject (ptoSrc , TROB_PAINT, hwnd, 0); /* make the call to StretchBlt() for the left half the window */ SendMessage (hwnd, WM_STRETCHBLT, 0,0); @@ -302,7 +311,7 @@ static HANDLE hPenGrid, hPenSeparator; BOOL success; /* erase source track object, or top left sides will show up in blt. */ - doTrackObject (ptoSrc , TROB_PAINT, hwnd, NULL); + doTrackObject (ptoSrc , TROB_PAINT, hwnd, 0); /* Get the parameters out of the top dialog box and call StretchBlt */ if (IsWindow(hwndDlg)) { @@ -348,7 +357,7 @@ static HANDLE hPenGrid, hPenSeparator; } /* redraw source track object which was erased temporarily. */ - doTrackObject (ptoSrc , TROB_PAINT, hwnd, NULL); + doTrackObject (ptoSrc , TROB_PAINT, hwnd, 0); } break; @@ -506,11 +515,8 @@ static HANDLE hPenGrid, hPenSeparator; break; /* end wm_command */ - - default: - return (DefWindowProc(hwnd, message, wParam, lParam)); - } - return (NULL); + } /* end switch */ + return (DefWindowProc(hwnd, message, wParam, lParam)); } @@ -770,8 +776,8 @@ char buffer[MAXCHARS]; return FALSE; /* end WM_COMMAND */ - } /* end switch */ - return (NULL); + } /* end switch */ + return 0; }