I am using Embarcadero RAD Studio XE for application development. I am trying to catch a drag file into an application with the following code
TMainForm = class(TForm) public: procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES; end; procedure TMainForm.FormCreate(Sender: TObject); begin DragAcceptFiles(Self.Handle, True); end; procedure TMainForm.FormDestroy(Sender: TObject); begin DragAcceptFiles(Self.Handle, False); end; procedure TMainForm.WMDropFiles(var Msg: TWMDropFiles); begin inherited; showmessage('catch here'); // some code to handle the drop files here Msg.Result := 0; end;
This code was executed without problems. Also, when I drag and drop files, the cursor shows that the status has changed to drag, but after everything has happened, nothing happens (no message is displayed). Is there something wrong with this?
source share