tags:

views:

307

answers:

1

I'm developing an interactive MFC application which displays a 3D object using my own algorithm, essentially using MFC as a framework, but using lots of pDC->Polygon(), pDC->Rectangle(), pDC->DrawText(), etc. calls.

The UI has numerous clickable areas which all work well. However, the onscreen controls for rotating, spinning, etc. the 3D image motivate users to double click, triple click, and beyond.

I'm 99% positive that CWnd::OnLButtonDown() is not called until Windows (or whatever) has decided the operation is not a double click, or when double clicked, but only once. That is a series of clicks results in a notification every second click. The user experience is stuttered rotation. The temporary workaround is to have users move the mouse slightly between clicks—It solves the problem, but is rather unfriendly.

The application does no double click event hooking. Maybe there's a way to go further to disable potential double click processing? Or maybe there is a lower-level way to capture the mouse button down?

+1  A: 

I think you have it backwards - the first click gets through as a WM_LBUTTONDOWN, the second one gets turned into a double-click.

To prevent a window from generating WM_LBUTTONDBLCLK messages, remove the CS_DBLCLKS style from the window.

This is all explained in the WM_LBUTTONDBLCLK documentation.

Edit: I misspoke, CS_DBLCLKS is a class style, not a window style. I don't think you can remove it, you have to create a new window class that doesn't include it. It's provided by MFC - see this page http://msdn.microsoft.com/en-us/library/a77269ff(VS.80).aspx.

Mark Ransom
Indeed, you are correct, OnLButtonDown <i>is</i> called on the first, third, etc. clicks, and the second, fourth, etc. clicks aren't delivered.There is no CS_DBLCLKS anywhere; I stepped through CreateWindow() and it has the style bits set from my `CMainFrame::PreCreateWindow`: WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_BORDERMaybe one of those is "expanded" for me?
wallyk
Forgive my delay in accepting your answer. I didn't realize the checkmark outline was a control....
wallyk