954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Mouse click coordinates

I'm learning Win API and decided to make a tic tac toe game. The game is supposed to check to see if the left mouse button is down and where it is being pressed so it will know when and where to draw the X or O. But the X is drawn in one spot (the only spot I've made code to draw it in) before the mouse is even clicked.

void drawX()
{
	if (WM_LBUTTONDOWN)
	{
             int x = LOWORD(lParam);
	    int y = HIWORD(lParam);
		
             if (x<300 && y<150)
             {
                 //draw X

Why doesn't the computer wait for a response from the mouse before it draws?

coonsquad20
Newbie Poster
1 post since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You