473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Purging mouse clicks, or flushing the mouse click buffer

Does anyone know how to get rid of excess mouse clicks? I have a
button that does some code which takes some time to execute. As soon
as the user clicks the button, I disable the button in the button
handler and enable it again when I exit the handler. However, if the
user clicks a bunch of times, say 10, during the time it's disabled
and executing for the first time, it will start to process the second
mouse click the moment the button gets enabled again. So basically,
if the code takes 5 seconds to execute and the user clicks 10 times
during that 5 seconds, then there will be another 10 runnings of that
code (50 seconds more to process the duplicate clicks). I really only
wanted to have the user run it once, until it gets enabled again and
they can properly click on it again. My idea is to completely get rid
of any queued up mouse clicks when I exit the button handler code (but
I don't know how to do that).

Any ideas on how to prevent multiple excess mouse clicks (since
disabling the button didn't work)?
Thanks,
ImageAnalyst

Jul 16 '07 #1
2 5398
On Jul 16, 5:01 pm, ImageAnalyst <imageanal...@mailinator.comwrote:
Does anyone know how to get rid of excess mouse clicks? I have a
button that does some code which takes some time to execute. As soon
as the user clicks the button, I disable the button in the button
handler and enable it again when I exit the handler. However, if the
user clicks a bunch of times, say 10, during the time it's disabled
and executing for the first time, it will start to process the second
mouse click the moment the button gets enabled again. So basically,
if the code takes 5 seconds to execute and the user clicks 10 times
during that 5 seconds, then there will be another 10 runnings of that
code (50 seconds more to process the duplicate clicks). I really only
wanted to have the user run it once, until it gets enabled again and
they can properly click on it again. My idea is to completely get rid
of any queued up mouse clicks when I exit the button handler code (but
I don't know how to do that).

Any ideas on how to prevent multiple excess mouse clicks (since
disabling the button didn't work)?
Thanks,
ImageAnalyst
Try adding an Application.DoEvents() - the disabled button should eat
the clicks.

// CHRIS

Jul 16 '07 #2
On Jul 16, 5:06 pm, Chris Morse <win32...@gmail.comwrote:
On Jul 16, 5:01 pm, ImageAnalyst <imageanal...@mailinator.comwrote:


Does anyone know how to get rid of excess mouse clicks? I have a
button that does some code which takes some time to execute. As soon
as the user clicks the button, I disable the button in the button
handler and enable it again when I exit the handler. However, if the
user clicks a bunch of times, say 10, during the time it's disabled
and executing for the first time, it will start to process the second
mouse click the moment the button gets enabled again. So basically,
if the code takes 5 seconds to execute and the user clicks 10 times
during that 5 seconds, then there will be another 10 runnings of that
code (50 seconds more to process the duplicate clicks). I really only
wanted to have the user run it once, until it gets enabled again and
they can properly click on it again. My idea is to completely get rid
of any queued up mouse clicks when I exit the button handler code (but
I don't know how to do that).
Any ideas on how to prevent multiple excess mouse clicks (since
disabling the button didn't work)?
Thanks,
ImageAnalyst

Try adding an Application.DoEvents() - the disabled button should eat
the clicks.

// CHRIS- Hide quoted text -

- Show quoted text -
Thanks Chris. This should probably acomplish the desired effect.
I'll give it a try tomorrow.
Regards,
ImageAnalyst

Jul 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pedro Sebastiao | last post by:
I need in urgence a program that simulates multiple mouse clicks in a windows xp application. I would appreciate if someone could send it to me. pedro.sebastiao@iol.pt
5
by: Mike | last post by:
Currently, when my application needs to write/read to a database, there is a time lag. In that time lag, a user can click the same button multiple times causing my app problems. I want to turn...
1
by: Mike | last post by:
Hi. In my app I am have a button which, when clicked, spawns a worker process. When the user clicks this button, I am setting its Enabled property to false to disable the button and prevent the...
1
by: Brent | last post by:
Hi Is there a way to detect a mouse click anywhere on the screen (not just on your form or a control on the form)? Thanks Brent
1
by: Per Larsson | last post by:
Hi all! I am working with a project and want to make a form that is semi transparent, and transparent to mouse clicks. (Se through and click through.) The form shall be visible but opaque and the...
0
by: Nickneem | last post by:
I' m trying to disable all right mouse clicks by using the vbAccelerator Windows Hooks Library The small (systray / console) app. must catch all (right) mouseclicks before they are received by...
0
by: ludwig.frank | last post by:
Hi, I am attempting to detect mouse clicks from within curses, using "select" on sys.stdin. It is working great within an xterm under X, but not very well in a "real" linux console. When I click...
3
by: =?Utf-8?B?cHJvZ2dlcg==?= | last post by:
I have a C# application that hosts an AxWebBrowser control which I automate by sending mouse clicks and keyboard input. I have had various problems in doing this due to a bug in the AxWebBrowser...
1
by: \(O\)enone | last post by:
I've added a TabControl to my WinForms app, and added a couple of tabs to the control. The result is that the top strip of the TabControl contains the two tabs, and then to the right of them is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.