Hi, I'm using this code to determine if the left mouse button is currently pressed:

Code:
bool leftMouseDown = GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? true : false;
..but it returns true until the first time I click the left button even if the left button is not pressed. After that it works as expected. Why could this be?

I'm guessing it has something to do with the fact that I left double-click the .exe file to start the program and that the mouse is because of that set in some unrefreshed state.

I tried to simulate an extra mouse click at startup using:

Code:
PostMessage (d3d.window, WM_LBUTTONDOWN, 0, 0);
PostMessage (d3d.window, WM_LBUTTONUP, 0, 0);
...but that made no difference.