-
Notifications
You must be signed in to change notification settings - Fork 273
Description
VirtualTrees.Pas, procedure TBaseVirtualTree.DragAndDrop, using windows 7. Parameter DragEffect has values that raises a range exception when the drag&drop operation implies scrolling in grid. The returned value of DragAndDrop should be casted to avoid range exception
procedure TBaseVirtualTree.DragAndDrop(AllowedEffects: Dword; const DataObject: IDataObject; var DragEffect: Integer);
var
lDragEffect: DWord; // required for type compatibility with SHDoDragDrop
begin
if IsWinVistaOrAbove then
begin
lDragEffect := DWord(DragEffect);
SHDoDragDrop(Self.Handle, DataObject, nil, AllowedEffects, lDragEffect); // supports drag hints on Windows Vista and later
DragEffect := Integer(lDragEffect); // ********* Cast Exception ******** // DragEffect := lDragEffect;
end
else
Winapi.ActiveX.DoDragDrop(DataObject, DragManager as IDropSource, AllowedEffects, DragEffect);
end;