Solved

detect count/how long the mouse down pressed

Posted on 2011-03-19
4
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 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