Open joachimmarder opened 6 years ago
GetVisible()
can also be removed because it will return always False on Windows 2000 or higher. And also code that is executed only if GetVisible()
returns True can be removed.
Also MoveRestriction
does not make sense any more afterwards.
+1
Header dragging still uses old code without IDragSourceHelper, we first need to revise header dragging code.
For header dragging it seems that we will need a dummy IDataObject
implementation to that we can attach a bitmap using IDragSourceHelper.InitializeFromBitmap()
in TVTDragImage.PrepareDrag()
.
we will need a dummy IDataObject implementation to that we can attach a bitmap
A quick test with TVTDataObject.Create(FOwner, False)
did not work.
The minimum code to show a Windows drag image is to add this at the end of TVTHeader.PrepareDrag()
before finally
:
var lDataObject := TVTDataObject.Create(nil, False);
FDragImage.PrepareDrag(Image, ImagePos, P, lDataObject);
var lDragEffect: DWord; // The last executed drag effect
SHDoDragDrop(fOwner.Handle, lDataObject, nil, DROPEFFECT_MOVE, lDragEffect); // supports drag hints on Windows Vista and later
However, the call to SHDoDragDrop()
prevents normal mouse move messages from arriving.
It indicates that application is running on Windows 2000 or higher where IDragSourceHelper is available. Windows 98 support has been dropped a long time ago. Along with thia flag
InternalShowDragImage()
,RecaptureBackground()
,DragTo()
andMakeAlphaChannel()
can be removed, which are only used if the OS does not natively support drag images.