Well, I don't think you meant to do this in DBpro, right? If you plan to make this program in VC++ using WinAPI, then yes there is way to do this.
Basically Windows programming are event driven. Meaning that it will notify events THAT HAPPENED IN YOUR OWN APPLICATION WINDOW to your program. Thus, this model doesn't work in your case.
There is 2 ways that I thought of to achieve your goals:
Way #1
1. Create a timer that fires WM_TIMER in certain interval, the smaller the better.
2. Handle that timer event and poll for for current mouse status, i.e. mouse position and its buttons status.
3. Check whether the current buttons status is same as previous one. If it is, then meaning that the status haven't change since last check. If the status changes, check whether the button is pressed. If it is, then record it the way you want it.
4. Keep the current status for next round.
Way #2
This way is more hardcore, it is dealling with write a so called "hook" in Windows. A mouse hook is basically a function that is connected to the Windows mouse interface. So whenever there is a mouse event happening, it will call whatever registered mouse hook function. The function will process it, and decides whether want to consume the event so that no other application will receive it, or pass on the event.
Hoped you can get what I mean. I am not a good teacher.
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.
http://www.badnose.com/