Ok, I've been fulling around for awhile...and this is what I got. I want it to loop and once you click on the 'X' it will quit...what is actually going on here? and how can i fix it please.
Code:
#include <windows.h>
#include <iostream>
using namespace std;
main(){
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ENABLE_MOUSE_INPUT);
bool Continue=1;
INPUT_RECORD InputRecord;
CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD dwCursorPosition={79,23};
DWORD Events=0;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),dwCursorPosition);
cout<<'x';
dwCursorPosition.X=0;
dwCursorPosition.Y=0;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),dwCursorPosition);
while(Continue==1){
ReadConsoleInput(GetStdHandle(STD_INPUT_HANDLE) , &InputRecord, 1, &Events);
if(InputRecord.EventType == MOUSE_EVENT)
{
if(InputRecord.Event.MouseEvent.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED){
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE),&csbi);
if(csbi.dwCursorPosition.X==79 && csbi.dwCursorPosition.Y==23){
Continue=0;
}
}
}
}
return 0;
}
It is a tad revised now, but I'm still having problems. It is atleast accepting mouse input now.