I read some of the blogs of cathyeagle. Article Finally, I learned more about drag-and-drop action capturing. After some tossing, we can finally capture the drag-and-drop action of IE, which makes everything difficult at the beginning. Some interface declarations mentioned in catheagle are not found in Delphi. After searching, the interface declaration is as follows. For more information about drag and drop, see the series of articles in catheagle's Internet Explorer programming overview.
// Idochostuihandler
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs, olectrls, shdocvw, ActiveX;
Type
Pdochostuiinfo = ^ tdochostuiinfo;
Tdochostuiinfo = record
Cbsize: ulong;
Dwflags: DWORD;
Dwdoubleclick: DWORD;
Chhostcss: polestr;
Chhostns: polestr;
End;
Type
Idochostuihandler = interface (iunknown)
['{Bd3f23c0-d43e-11cf-893b-00aa00bdce1a}']
Function showcontextmenu (const dwid: DWORD; const PPT: Ppoint;
Const pcmdtreserved: iunknown; const pdispreserved: idispatch): hresult; stdcall;
Function gethostinfo (VAR pinfo: tdochostuiinfo): hresult; stdcall;
Function showui (const dwid: DWORD; const pactiveobject: ioleinplaceactiveobject;
Const pcommandtarget: iolecommandtarget; const pframe: ioleinplaceframe;
Const pdoc: ioleinplaceuiwindow): hresult; stdcall;
Function hideui: hresult; stdcall;
Function updateui: hresult; stdcall;
Function enablemodeless (const fenable: bool): hresult; stdcall;
Function ondocwindowactivate (const factivate: bool): hresult; stdcall;
Function onframewindowactivate (const factivate: bool): hresult; stdcall;
Function resizeborder (const prcborder: prect;
Const puiwindow: ioleinplaceuiwindow;
Const framewindow: bool): hresult; stdcall;
Function translateaccelerator (const lpmsg: PMSG; const pguid1_group: pguid;
Const n1_id: DWORD): hresult; stdcall;
Function getoptionkeypath (VAR pchkey: polestr; const DW: DWORD): hresult; stdcall;
Function getdroptarget (const pdroptarget: idroptarget;
Out ppdroptarget: idroptarget): hresult; stdcall;
Function getexternal (Out ppdispatch: idispatch): hresult; stdcall;
Function translateurl (const dwtranslate: DWORD; const pchillin: polestr;
VaR ppchurchill: polestr): hresult; stdcall;
Function filterdataobject (const PDO: idataobject; out ppdoret: idataobject): hresult; stdcall;
End;
// Icustomdoc
Icustomdoc = interface (iunknown)
['{3050f3f0-98b5-11cf-bb82-00aa00bdce0b}']
Function setuihandler (const puihandler: idochostuihandler): hresult; stdcall;
End;