I have the following code:
#include<windows.h>
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
HWND myconsole = GetConsoleWindow();
HDC mydc = GetDC(myconsole);
int x = 150;
int y = 150;
COLORREF COLOR = RGB(255, 255, 255);
SetPixel(mydc, x, y, COLOR);
ReleaseDC(myconsole, mydc);
cin.ignore();
return 0;
}
Where a pixel is drawn in the console's coordinate (150, 150).
I would like to know how I can get the coordinate of the mouse position, to use it to draw such a pixel.