There is also a very direct way of figuring out whether a key or mouse button is down, though requires a hard loop to be constantly checking for it. The function GetKeyState(int) will tell you whether any key/mouse button is being pressed at a given time. You can use it like this:
byte keyState = GetKeyState(VK_MButton);
if(keyState & 128)
//mouse is down
else
//mouse is not down
Although Callback functions are most traditional, this function can come in handy when you wish to, say, use the mouse to "drag" a picture around the screen.