Discussion:
Disable double klicks
(too old to reply)
Hans J. Ude
2004-01-10 16:12:43 UTC
Permalink
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.

TIA,
Hans
Johan Rosengren
2004-01-10 17:12:35 UTC
Permalink
Hans,

Windows receive double click notifications if they have the CS_DBLCLKS style
set. You might - depending on the kind of window where you don't want the
double clicks, use CWnd::PreCreateWindow to modify the class.

Johan Rosengren
Abstrakt Mekanik AB
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Normand
2004-01-10 20:01:16 UTC
Permalink
Is it possible or a good idea then to use ModifyStyle to disable that style?
Post by Johan Rosengren
Hans,
Windows receive double click notifications if they have the CS_DBLCLKS style
set. You might - depending on the kind of window where you don't want the
double clicks, use CWnd::PreCreateWindow to modify the class.
Johan Rosengren
Abstrakt Mekanik AB
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Joseph M. Newcomer
2004-01-11 06:16:53 UTC
Permalink
It is probably not possible. Many styles affect only the creation; once created, changing
them has no effect. You could try it, but it is fairly unlikely.
joe
Post by Normand
Is it possible or a good idea then to use ModifyStyle to disable that style?
Post by Johan Rosengren
Hans,
Windows receive double click notifications if they have the CS_DBLCLKS
style
Post by Johan Rosengren
set. You might - depending on the kind of window where you don't want the
double clicks, use CWnd::PreCreateWindow to modify the class.
Johan Rosengren
Abstrakt Mekanik AB
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Johan Rosengren
2004-01-11 07:25:22 UTC
Permalink
Hans,

It's a class-, not a window style, so I don't think that is possible.

Johan Rosengren
Abstrakt Mekanik AB
Post by Normand
Is it possible or a good idea then to use ModifyStyle to disable that style?
Post by Johan Rosengren
Hans,
Windows receive double click notifications if they have the CS_DBLCLKS
style
Post by Johan Rosengren
set. You might - depending on the kind of window where you don't want the
double clicks, use CWnd::PreCreateWindow to modify the class.
Johan Rosengren
Abstrakt Mekanik AB
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Yan-Hong Huang[MSFT]
2004-01-12 07:03:36 UTC
Permalink
Hi Norman,

Thanks for your post.

Based on my understanding, the question is: Is it possible to use
ModifyStyle to change CS_DBLCLKS?

We can't use CWnd::GetStyle to do so. However, from long before,
http://www.microsoft.com/msj/archive/SD71.aspx. We can see that using
SetClassLong can set this CS_DBLCLKS to a window. So you may try using
SetClassLong with this style to see if it works.

If you have any more concerns on it, please feel free to post here.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! šC www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Normand
2004-01-11 07:15:26 UTC
Permalink
You can use SetDoubleClickTime(UINT ulInterval)
where ulInterval is in milliseconds. I set it to 1 and I could not
doubleclick anymore.
If you use 0, the default (500 ms) is used.
Normand
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Alexander Grigoriev
2004-01-11 16:27:30 UTC
Permalink
Don't do that. It's global setting and will affect all other application
running. The users will be confused.

Again, you have to remove CS_DBLCLK from your window class.
Post by Normand
You can use SetDoubleClickTime(UINT ulInterval)
where ulInterval is in milliseconds. I set it to 1 and I could not
doubleclick anymore.
If you use 0, the default (500 ms) is used.
Normand
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Joseph M. Newcomer
2004-01-12 01:45:13 UTC
Permalink
This pemanently sets all double-click times for the entire system! This means you would
not be able to double-click anything, anywhere!

Note: if you have the double-click handler call the same function as the single-click
handler, then the difference will disappear!
joe
Post by Normand
You can use SetDoubleClickTime(UINT ulInterval)
where ulInterval is in milliseconds. I set it to 1 and I could not
doubleclick anymore.
If you use 0, the default (500 ms) is used.
Normand
Post by Hans J. Ude
Does somebody know how I can prevent the mouse driver from translating
two fast klicks to a doubleklick message? I want to receive only
WM_LBUTTONDOWN and WM_LBUTTONUP messages on quick repeats. This must
only happen in my program, not in the whole system. And also how to
re-enable the normal behaviour. The reason is to generate quick midi
note on/off events.
TIA,
Hans
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Hans J. Ude
2004-01-12 11:36:49 UTC
Permalink
Thanks to all who answered. A call to Get/SetClassLong in OnCreate()
of my view with the GCL_STYLE parameter finally succeeded to remove
the CS_DBLCLKS style.

Hans

Loading...