0

I need to track an event when the user grabs an image in one place of RichEdit field, drags it to another one and then drops it there.

But in those cases when the user press left mouse button, holds it down and move mouse some place elsewhere, WM_LBUTTONUP message doesn't fire in RichEdit procedure, so I can't get the moment, when the user "drops" an image.

So how should I detect WM_LBUTTONUP or may be drag'n'drop event in a RichEdit control?

tester
  • 43
  • 2
  • 8
  • WM_LBUTTONUP even doesn't fire in RichEdit when I click fast (not double, just fast). It only fires when I press LMB, holds it for a second, then release. Then WM_LBUTTONUP even is triggered. – tester Apr 18 '18 at 13:09

1 Answers1

0

According to MSDN you must set the ENM_DRAGDROPDONE flag with the EM_SETEVENTMASK message and then you will receive EN_DRAGDROPDONE in WM_NOTIFY.

When a window/control does not support drag & drop you would normally subclass and use SetCapture in the button down message so you are notified about later mouse messages taking place outside your window...

Anders
  • 97,548
  • 12
  • 110
  • 164