System: Vista
What I want to do is to catch the mouse release event, which I have researched for but nothing useful came up. I found out the way to catch the pressed event:
#include <windows.h>
#include <iostream>
int main()
{
// Grab a handle to the console inputbuffer
HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE);
DWORD dwRead = 0;
INPUT_RECORD InputRec;
// Start looping, waiting for messages
while( TRUE )
{
// See if there's any messages
ReadConsoleInput(hConsole,&InputRec,1,&dwRead);
if((InputRec.EventType == MOUSE_EVENT)&&(InputRec.Event.MouseEvent.dwButtonState & FROM_LEFT_1ST_BUTTON_PRESSED))
{
printf("Left Mouse - Pressed.\n");
}
}
}
What I want to use it for is to catch the time elapsed between the 'pressed' and 'released' event.