Solved

detect count/how long the mouse down pressed

Posted on 2011-03-19
4
304 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
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 85

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Capture logon name 13 70
Problem!!! 8 33
Example works but why do I need to click twice on button 4 36
Winform Module - What is the ASP.Net equiv 2 19
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

815 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

12 Experts available now in Live!

Get 1:1 Help Now