How can MDI form of Delphi application receive and process WM_DROPFILES Windows message?

216 Views Asked by At

I am developing Delphi application in the older Delphi versions (Delphi 6, the essential thing here is that older Delphi versions have no Messaging unit) and I am using approach described https://delphidabbler.com/articles/article-11 and available as demo application at https://github.com/delphidabbler/article-demos/tree/master/article-11.

The essential thing is that Delphi form registers itself as the listener of WM_DROPFILES by:

  1. setting in the form create:

    DragAcceptFiles(Self.Handle, True);

  2. declaring and implementing handler:

    procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES;

As can be seen from demo application, then this approach works. But I have MDI application: main form has FormStyle:=fsMDIForm and the children forms have FormStyle:=fsNormal and putting the mentioned code in the child forms leads to no results - message procedure is not called. I have tried to put this code both in main and children forms and try to observe, whether handlers from both forms are being called, but I can see that the handler from the main form is being called only.

Maybe MDI organization does not allow catching file-drop messages in the child forms at all?

0

There are 0 best solutions below