limelect 48 Posted February 2 (edited) D10.2.3 window 7 I have had this problem for many years I wonder if there is a solution The program does not break on message in the IDE However, running the execution it works. P.S I see the + sign on the form when dragging a file wile in the IDE Drag and Drop do not work either I saw David Heffernan solution, but it did not help. https://stackoverflow.com/questions/14244325/drag-and-drop-files-to-delphi-form-not-working Any help? . unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, ProCtrls, Vcl.StdCtrls; type TForm1 = class(TForm) procedure FormDestroy(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses ShellAPI; procedure TForm1.WMDropFiles(var Msg: TWMDropFiles); begin inherited; MessageDlg('dssdfsd', mtWarning, [mbOK], 0);<<<<<<<<<<<< does not break end; procedure TForm1.FormDestroy(Sender: TObject); begin DragAcceptFiles(Self.Handle, False); inherited; end; procedure TForm1.FormCreate(Sender: TObject); begin inherited; DragAcceptFiles(Self.Handle, True); end; end. Edited February 2 by limelect Share this post Link to post
PeterBelow 238 Posted February 2 Delphi forms tend to recreate their window handle at the drop of a hat. So move the DragAcceptFiles calls from the events to overridden CreateWnd and DestroyWnd methods, that makes sure the handle changes are properly handled. 1 Share this post Link to post
limelect 48 Posted February 2 (edited) @PeterBelow can you plz give me a few lines of code thanks p.s do not forget official drag and drop do not work either in the ide Edited February 2 by limelect Share this post Link to post
Remy Lebeau 1393 Posted February 2 (edited) 3 hours ago, limelect said: @PeterBelow can you plz give me a few lines of code There is code for exactly that in David's answer on the StackOverflow post you linked to. 3 hours ago, limelect said: p.s do not forget official drag and drop do not work either in the ide If you are running your app (or the IDE) with elevated rights, then you also need to call ChangeWindowMessageFilter/Ex() to allow lesser-privileged processes, like File Explorer, to send WM_DROPFILES messages to your app. Edited February 2 by Remy Lebeau 1 Share this post Link to post
Anders Melander 1782 Posted February 2 The Drag and Drop Component Suite contains a demo application that can be used to diagnose a drop target (there's one for drop sources too, fwiw). You could use that to determine the exact interaction between the drop source and target. There is also a demo of WM_DROPFILES, including the handling of ChangeWindowMessageFilter*. The screenshot below shows the Drop Target Analyzer dropping CF_HDROP data (i.e. a file) onto the WM_DROPFILES demo, which is running elevated. 1 Share this post Link to post
limelect 48 Posted February 3 @Anders MelanderI am I to drop a file onto the main pan? In my ide it does not work. it has an impossible sign. Share this post Link to post
limelect 48 Posted February 3 (edited) @Remy Lebeau @Anders Melander as i said on my D10.2.3 IDE nothing works as for drop As for my basic demo, I did exactly the suggestion no !!!! breakpoint in ide how ever message works with exe as for the analyzer I cannot drop either in ide or exe I doubt that I can be helped. it has something to do with my d10.2.3 and my Windows 7 system I guess. One more option is that a component I install does the problem But since I have large amount it is impossible to find which. OR an expert? Thanks Edited February 3 by limelect Share this post Link to post
Anders Melander 1782 Posted February 3 8 hours ago, limelect said: as for the analyzer I cannot drop either in ide or exe What events does the analyzer show? 8 hours ago, limelect said: One more option is that a component I install does the problem Hmm. The D&D suite disables the Delphi IDE as a drop target during debugging to avoid the deadlock that would occur if the application being debugged was the drop source and the IDE the drop target. You can try to uninstall the D&D suite design time package to see if that is the cause. Share this post Link to post
limelect 48 Posted February 3 1 hour ago, Anders Melander said: The D&D suite disables the Delphi IDE Could you plz elaborate I do not recognize this May be send me link so I know what it si Share this post Link to post
Anders Melander 1782 Posted February 3 2 minutes ago, limelect said: Could you plz elaborate I do not recognize this https://bitbucket.org/anders_melander/drag-and-drop-component-suite/src/master/ or https://github.com/landrix/The-Drag-and-Drop-Component-Suite-for-Delphi Share this post Link to post
limelect 48 Posted February 3 P.S i tried my test shown above in release It did not help Share this post Link to post
limelect 48 Posted February 3 I disabled D&d it did not help I know my problem is someplace in the IDE Share this post Link to post
limelect 48 Posted February 9 I do not know if this help The problem of drag and drop (I did not check for messages) Persist with D7 too. Drage and Drop does not work on D7 either. Only outside of Delphi. So it is Windows 7 ported to ANY Delphi. Any idea how to check this? \ Share this post Link to post
Anders Melander 1782 Posted February 9 1 minute ago, limelect said: So it is Windows 7 ported to ANY Delphi. Any idea how to check this? Are you asking if any version of Delphi supports Windows 7? Share this post Link to post
limelect 48 Posted February 9 (edited) No they all work with this Windows 7. With no problems All I say is that Drag and Drop does not work under above conditions in the IDE. Neither the message problem work on D7 which mean that there is a System problem interacted with Delphi IDE Edited February 9 by limelect Share this post Link to post
limelect 48 Posted February 9 I just found that drag-drop within a Delphi project will in the IDE works Share this post Link to post