You don't say which program you are using, so I'll use the first as an example. I started a new console project in VC and added the source file with a .c extension rather than .cpp.
To get it to compile, I had to change the "cout" statements to printf() function calls. I had to comment out the iostream include and the namespace directive, and include <stdio.h>, then I had to change the type "bool" to "boolean" It then compiled and ran.
If that doesn't work, I'll need to know where it is failing and what error message you are getting.
//using namespace std;
boolean Continue = TRUE;
int KeyEvents = 0;
int MouseEvents = 0;
hIn = GetStdHandle(STD_INPUT_HANDLE);
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
// cout << "Key Events : " << endl;
// cout << "Mouse Events : " << flush;
printf("Key Events : \n");
printf("Mouse Events : ");
KeyWhere.X = 15;
KeyWhere.Y = 0;
MouseWhere.X = 15;
MouseWhere.Y = 1;
EndWhere.X = 0;
EndWhere.Y = 3;
// cout << KeyEvents << flush;
if (InRec.Event.KeyEvent.uChar.AsciiChar == 'x')
// cout << "Exiting..." << endl;
Continue = FALSE;
// cout << MouseEvents << flush;