CMFCTaskpane drag and drop

abc abc 346 Reputation points


In MDI application, I have views and CMFCTaskpane and other panes.

I subclassed CMFCTaskpane and I implemented drag and drop.

For implementing drag and drop, I am calling DragDetect() in OnLbuttondown to check whether drag is started or not. But if DragDetect() returns false it suppresses the WM_LBUTTONUP. In CMFCTaskpane generally when user do normal click , the OnLbuttondown and OnLButtonUp will be called and OnLButtonUp calls OnClickTask, but if I call DragDetect() in OnLbuttondown it suppresses the WM_LBUTTONUP so normal click operation is not working.

How to check the drag operation is started or not in OnLbuttondown without using DragDetect()?


A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,759 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 30,216 Reputation points

    One solution to the problem is to use the Ctrl key + WM_LBUTTONDOWN to identify a drag and drop operation. In the mouse handler only initiate drag and drop if the Ctrl key is down.