#include #include #include #include PrintUsage() { printf("test case for bug #78891 - reported by Chris Mah, April 15th 1997\n"); printf("Uses WriteConsoleInput() to inject keystrokes for \"ESC y\"\n"); printf("WritEscY attempts to inject \"ESC y\" into the console input stream\n"); printf("It does this by constructing KeyEvents with scancode and VK values for\n"); printf("the Escape and Y key obtained via VkKeyScan() and MapVirtualKey().\n"); printf("Usage: writescy [-x]\n"); printf(" -x : use VK_ESCAPE literally\n"); printf(" (default uses VkKeyScanEx(0x1b) to get the VK)\n"); } int _cdecl main(int argc, char *argv[]) { DWORD dwNumWrites; INPUT_RECORD inputESC_Y[6]; BOOL retval; int iArg; BOOL fLiteral = FALSE; /* * Compute the flags */ for (iArg=1; iArg