I've been interested in working with mouse input in Visual Studio using C++. I'm curious what steps need to be taken to do this. I'm assuming some sort of Windows header file needs to be included, but I have never seen any code for such things. Basically I want to be able to simply cout some info whenever the user clicks somewhere. It would be really cool if it would work so that it happens whenever the user clicks ANYWHERE on the desktop, but I'm not sure how that would work....Any direction would be greatly appreciated! THANKS


Recommended Answers

All 6 Replies

Ok, thanks for the link. How can I make my program run and operate so that it runs in the background and responds/'cout's something whenever mouse button is clicked while the user is trying to click on something on the desktop?? Any ideas with that?!? Thanks!

To hide the console window check this
For the user clicking on the desktop here is a win32 Program

Ok, so the link about hiding the console window works perfectly for what i wanted. You're just full of different links aren't you?! Lol thanks. However, the other link was way to confusing for me. All I'm tryin to do there is make some code that pops up some stupid message whenever the user attempts to click an icon that's on the desktop. Is there any easier suggestions for me to do that?!? Thanks! :)

Anything at all?!?

I had been searching with Google, but I did not find anything other than the hook up method that Williamhemsworth used(the link I gave). You need to have some patience. Perhaps someone else can help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.