1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
procedure TclMainWnd.clMainMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
const
Threshold = 5;
var
SelFileList: TStrings;
i: Integer;
DataObject: IDataObject;
Effect: Integer;
Dh : TDropHandle;
begin
with Sender as TImage do
begin
if (filesList.Count > 0) and (csLButtonDown in ControlState)
and ((Abs(X - FDragStartPos.x) >= Threshold)
or (Abs(Y - FDragStartPos.y) >= Threshold)) then
begin
Perform(WM_LBUTTONUP, 0, MakeLong(X, Y));
SelFileList := TStringList.Create;
try
SelFileList.Capacity := filesList.Count;
for i := 0 to filesList.Count - 1 do
SelFileList.Add(filesList[i]);
DataObject := GetFileListDataObject('', SelFileList);
finally
SelFileList.Free;
end;
Effect := DROPEFFECT_COPY;
Dh:=TDropHandle.Create(DataObject);
Dh.Execute;
end;
end; |
Partager