Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture Mouse Click 1

Status
Not open for further replies.

lmb3

Programmer
Jul 10, 2001
16
US
I need to capture a click from a wireless mouse and then cause an event to happen in my program. I don't care where on the screen the mouse is when it clicks, I just want to know that it has clicked and then I want to trigger another process. Is this possible? Can you capture a mouse click if it's not on a certain object (form, text box, etc) in your program?
Thanks!
 
Yes you can, but you'll need to use some API functions (GetCapture, SetCapture, ReleaseCapture, etc.). It allows you to "Capture" the mousepointer to your form's MouseMove Event. Then, even if the mouse is not over the form, the form's mousemove event will keep firing. Windows can however release this capture without warning, and clicking anywhere will also automatically release the capture. _________________
Bixarrio
e = m * (c ^ 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top