--- mstools/samples/console/writein.c 2018/08/09 18:20:36 1.1 +++ mstools/samples/console/writein.c 2018/08/09 18:23:13 1.1.1.3 @@ -1,3 +1,14 @@ + +/******************************************************************************\ +* 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. +\******************************************************************************/ + #include #include #include @@ -32,9 +43,10 @@ void demoWriteIn(HANDLE hConOut) DWORD dwBytesWritten, dwRecordsWritten; CHAR bOutBuf[256]; /* buffer to format event information into */ BOOL bRecording = FALSE; /* TRUE if recording a macro */ - int iir; /* index into macro input buffer */ + int iir = 0; /* index into macro input buffer */ CHAR c; + setConTitle(__FILE__); myPuts(hConOut, "\n\nLet's implement a simple macro record/playback facility.\n" "Hit Alt+R to record, and Alt+P to playback. After turning\n" "on Record mode, enter some keystrokes or mouse clicks.\n" @@ -43,7 +55,7 @@ void demoWriteIn(HANDLE hConOut) "insert the recorded events into the input buffer.\n" "Hit ESC at any time to return."); hStdIn = GetStdHandle(STD_INPUT_HANDLE); - PERR((int) hStdIn != -1, "GetStdHandle"); + PERR(hStdIn != INVALID_HANDLE_VALUE, "GetStdHandle"); for(;;) { /* if our macro event buffer is full, leave Record mode */