Solved

detect count/how long the mouse down pressed

Posted on 2011-03-19
4
307 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 86

Expert Comment

by:Mike Tomlinson
ID: 35172884
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
ID: 35172937
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 86

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 35172982
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
ID: 35178401
thank you
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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