Solved

detect count/how long the mouse down pressed

Posted on 2011-03-19
4
300 Views
Last Modified: 2013-12-17
detect count/how long the mouse down pressed <even outside of the main form application>
0
Comment
Question by:systan
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
You could use a hook via WH_MOUSE_LL to get global mouse messages...

See Bob's (TheLearnedOne) example here:
http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21475143.html
0
 
LVL 14

Author Comment

by:systan
Comment Utility
thank you, but I already have that links and downloaded it;  what i am after is to count the number of seconds a mouse is down.  i don't know where to merge the code.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
Comment Utility
Use the StopWatch() class:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx

Start it when WM_LBUTTONDOWN is received and stop it when you get a WM_LBUTTONUP.
0
 
LVL 14

Author Closing Comment

by:systan
Comment Utility
thank you
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now