CMFCTaskpane drag and drop

abc abc 351 Reputation points
2020-12-29T06:04:32.317+00:00

Hi,

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()?

Thanks

C++
C++
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.
3,542 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 40,771 Reputation points
    2020-12-29T15:17:53.39+00:00

    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.

    0 comments No comments