I need a function that will return the current state of the left mouse button.
The obvious answer would be to have a static boolean variable that changes according to WM_LBUTTONDOWN/UP messages. However, this doesn't take into account whether the mouse button was released on a child window, or outside of the main window even.

Any suggestions apreciated.