DragAcceptFiles(Handle, True);
reports the currently used window handle for the form as accepting files. Some changes to the form cause the window handle to be destroyed and recreated, and changing the style is one of them. When this happens, FormCreate
is not called again. When the window handle gets recreated, you need to also report the new handle as accepting files. You can simply move the code in your FormCreate
to CreateWnd
for that:
type
TForm1 = class(TForm)
private
{ Private declarations }
protected
procedure CreateWnd; override;
public
{ Public declarations }
end;
implementation
procedure TForm1.CreateWnd;
begin
inherited;
DragAcceptFiles(Handle, True);
end;