If a dialog registers some of its controls as drop-targets, will drag'n'drop messages intended for those controls pass through the dialog's message processing in a way that the dialog can register a message handler to be notified/intercept those messages?
In a similar fashion to this question, I want to catch drag'n'drop events at a higher level in certain circumstances, before individual drop-handlers are invoked. But That question's answers suggest this isn't really possible? How to disable drag/drop when a dialog box is open
If the controls are using
DragAcceptFiles()
,WM_DROPFILES
messages will go directly to the window procedures of the individual controls, not to the window procedure of the dialog. If you want to intercept the messages, you will have to subclass the individual controls usingSetWindowLongPtr()
orSetWindowSubClass()
, or use a message hook fromSetWindowsHookEx()
.If the controls are using
RegisterDragDrop()
instead, drag&drop operations will not go through any window procedures at all, as OLE drag&drop does not use window messages.This would only be possible with
DragAcceptFiles()
and subclassing/hooking.