3
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 at the console’s (150, 150) coordinate.
I would like to know how I do to take the coordinate of the mouse position, to use it to draw such pixel.
It worked, vlw :D
– Jonathan Barcela