Hi, I was wondering what is wrong with this code?
BOOL Test = FALSE;
hdc = BeginPaint(hWnd, &ps);
if (Test == FALSE)
SetPixel(hdc, 20, 20, 0x000000FF);
SetPixel(hdc, 200, 20, 0x0000FF00);
Test = TRUE;
What the code is supposed to do is clear. If the user doesn't leftclick in the Clientarea, a Red pixel is drawn at 20, 20. Else a green one is drawn at 200, 20.
I'm writing a digitalising program, so I don't know how many points I have to mark, but I thought that this code would draw a red pixel and after a leftclick a green one. The interesting thing is, that the red one stays there, but after scrolling the green one disappears. I want them both to stay, but how can I do that. What's wrong with my code???