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;