问题描述
我要寻找一个例子如何实现的下降目标在web浏览器。作为一名'基地'code,我将使用这个答案。
I am looking for an example how to implement IDropTarget within WebBrowser. As a 'base' code I will be using this answer.
推荐答案
在理论上,你应该换为<$ C原下降目标
对象,从MSHTML传递给你$ C>的IDocHostUIHandler :: GetDropTarget ,然后返回自己的实现下降目标,这将转发所有的
下降目标
方法,即原来的对象,但有一个例外: ::下降目标的DragEnter
In theory, you should wrap the original
IDropTarget
object, passed from MSHTML to you at IDocHostUIHandler::GetDropTarget
, and return your own implementation of IDropTarget
, which would forward all IDropTarget
methods to that original object, with one exception: IDropTarget::DragEnter
.
在你执行
::下降目标的DragEnter
,你会检查的IDataObject
对象,其中包含有关数据被丢弃(的IDataObject :: EnumFormatEtc
),并返回 DROPEFFECT_NONE
如果数据是不能接受的,否则将其转发了。
In your implementation of
IDropTarget::DragEnter
, you would check the IDataObject
object which contains the data about to be dropped (IDataObject::EnumFormatEtc
) and return DROPEFFECT_NONE
if the data is not acceptable, otherwise forward it too.
我没有这种现成使用的code样本。随意试验并发布自己的答案,当你到达那里。
I don't have a ready-to-use code sample for this. Feel free to experiment and post your own answer when you get there.
这篇关于web浏览器:下降目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!