我正在从 Outlook 中拖放电子邮件附件。文件被放入虚拟树视图中。
我在拖拽事件结束时的导入功能需要一段时间来处理文件,它会冻结 Outlook 应用程序,直到功能结束。
我希望能够在功能中途结束拖动操作。
procedure TForm.vstItemsDragDrop(Sender: TBaseVirtualTree;
Source: TObject; DataObject: IDataObject; Formats: TFormatArray;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);
var
fileList : IStringList;
drop : IOleDrop;
begin
fileList:= TIStringList.Create;
drop := COleDrop.Create.def(DataObject);
fileList := drop.GetDroppedFileList(fileWarnings);
//I want to terminate the drag operator here because I already have what I need
//This imports parts takes a while to run so I want to end the drag and drop operation
//Outlook freezes still has cursor state on copy and doesn't respond to clicks or ESC
ImportParts( fileList)
end;