Einzelnen Beitrag anzeigen

SpockHH

Registriert seit: 17. Apr 2019
Ort: Hamburg
4 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: Seltsames Drag&Drop Problem in Firemonkey seit Delphi 10.42

  Alt 1. Mai 2021, 18:48
Hallo jziersch,

Deine Lösung funktioniert zwar nicht (DragOver wird ja gar erst ausgelöst), aber Du hast mich auf die richtige Spur gebracht. Vielen Dank dafür.

Man muss die Unit FMX.Platform.Win modifizieren, hier der geänderte Codeschnipsel (Änderungen sind mit "// nol+" gekennzeichnet):

function TWinDropTarget.DragOver(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT;
var
P: TPointF;
Operation: TDragOperation;
LScale: single; // nol+
begin
Result := E_UNEXPECTED;
try
dwEffect := DROPEFFECT_NONE;
P := PointF(pt.X, pt.Y);

// nol+ begin
LScale := WindowHandleToPlatform(Form.Handle).Scale; // var LScale: single;
P.X := Round( P.X / LScale );
P.Y := Round( P.Y / LScale );
// nol+ end
Arnd
  Mit Zitat antworten Zitat