Can you please give me sample code of a Win32 console application that will hook to Windows through the API and listen for mouse clicks (all mouse clicks in the OS; not just the clicks on the app's window)?

I looked high and low for this, but couldn't find it or learn how to do it.

I'd take your code, compile it in Visual C++ Express, and learn a lot from it. I hope that it'll be my door to finally wrapping my head around Win32 API because I'll have started with a little proggy that I'm really interested in, for a change.

Only the first link is sample code, which unfortunately doesn't compile. I posted a message regarding that in the code's own thread.

The other links are some backwardly introduced Win32 hook concepts that can probably only be read and understood by someone who already knows a lot about Win32 API.