Double-click in an OpenGL window?

Has anyone ever got a double-click event from an OpenGL window? I have ON_WM_LBUTTONDBLCLK() in my BEGIN_MESSAGE_MAP section, and a function to handle the event:

void
CPolyView::OnLButtonDblClk(UINT nFlags, CPoint point)
{...}

But it never gets called. Other mouse events (single-click, mouse move) work fine.

Any ideas?
Thanks,
Rob.

From the documentation :

Only windows that have the CS_DBLCLKS style can receive WM_LBUTTONDBLCLK messages, […]
So just add that flag to the ‘style’ member of the ‘WNDCLASS’ that you pass to ‘RegisterClass’ and it should start to work.

Originally posted by samv:
So just add that flag to the ‘style’ member of the ‘WNDCLASS’ that you pass to ‘RegisterClass’ and it should start to work.
Thanks. I don’t call RegisterClass at all, but I found a way to make it work by adding these lines to OnCreate() for the OpenGL window:

	long lStyle = GetClassLong(m_hWnd,GCL_STYLE);
	SetClassLong(m_hWnd,GCL_STYLE,lStyle | CS_DBLCLKS);

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.