Reading that again, it does look messy. There are a lot of functions to import and some structures are involved as well! Ugh!
It first looked like you want SetWindowsHookEx in User32.lib according to the bottom of the MSDN page if you were going by the CodeProject article. MSDN usually lists header files and libraries at the bottom of these pages, along with the applicable versions of Windows.
I will say, from reading the article again, this is implementing a timer and using some callbacks, which is going to get really ugly FAST. I'm sorry, but my help now isn't helping any more either.
Did I tell you how much I hated Microsoft API's?
We know this is possible (at least using undocumented API's) since Windows screensavers do this. Can I ask why you are trying to get this info? It might be possible to do something sneaky like (DARE I SAY IT?) find some Windows screensaver source on the internet, and install your program as a screensaver (using pure C++ code) embedding a Perl interpreter when neccessary? Do you enjoy pain?
The last bit of brainstorming I have is to just check the mouse position and snoop on the keyboard, but I have no idea exactly how that is possible either without a huge performance drain. It _really_ sounds like you want to register for callbacks or to find a way to query this info -- but where?
|