对话框能否拦截传递给其控件的拖放消息?
Can a dialog intercept drag'n'drop messages passed to its controls?
如果对话框将其某些控件注册为放置目标,则用于这些控件的拖放消息将以对话框可以将消息处理程序注册为 notified/intercept 那些消息?
以与此问题类似的方式,我想在某些情况下在更高级别捕获拖放事件,在 调用单个拖放处理程序之前。但是那个问题的答案表明这真的不可能吗? How to disable drag/drop when a dialog box is open
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?
如果控件使用 DragAcceptFiles()
,WM_DROPFILES
消息将直接转到各个控件的 window 过程,而不是对话框的 window 过程.如果要拦截消息,则必须使用 SetWindowLongPtr()
或 SetWindowSubClass()
对各个控件进行子类化,或者使用 SetWindowsHookEx()
.
中的消息挂钩
如果控件使用 RegisterDragDrop()
,拖放操作根本不会经过任何 window 过程,因为 OLE 拖放不使用 window 消息。
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?
只有 DragAcceptFiles()
和 subclassing/hooking 才有可能。
如果对话框将其某些控件注册为放置目标,则用于这些控件的拖放消息将以对话框可以将消息处理程序注册为 notified/intercept 那些消息?
以与此问题类似的方式,我想在某些情况下在更高级别捕获拖放事件,在 调用单个拖放处理程序之前。但是那个问题的答案表明这真的不可能吗? How to disable drag/drop when a dialog box is open
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?
如果控件使用 DragAcceptFiles()
,WM_DROPFILES
消息将直接转到各个控件的 window 过程,而不是对话框的 window 过程.如果要拦截消息,则必须使用 SetWindowLongPtr()
或 SetWindowSubClass()
对各个控件进行子类化,或者使用 SetWindowsHookEx()
.
如果控件使用 RegisterDragDrop()
,拖放操作根本不会经过任何 window 过程,因为 OLE 拖放不使用 window 消息。
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?
只有 DragAcceptFiles()
和 subclassing/hooking 才有可能。