title: Drag and Drop files to Delphi form not working
body: <p>I've tried to accept files that are dragged and dropped to a Form from the File Explorer but it doesn't work. My WM_DROPFILES handler is never called. I'm running Windows 8 if that makes any difference.</p>
  
  <p>Here's a simple example of what I do (I just have a TMemo on the form):</p>
  
  <pre><code>type
    TForm1 = class(TForm)
      Memo1: TMemo;
    private
      { Private declarations }
      procedure WMDROPFILES(var msg : TWMDropFiles) ; message WM_DROPFILES;
      procedure CreateWnd; override;
      procedure DestroyWnd; override;
    public
      { Public declarations }
    end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  { TForm1 }
  
  procedure TForm1.CreateWnd;
  begin
    inherited;
    DragAcceptFiles(Handle, True);
  
  end;
  
  procedure TForm1.DestroyWnd;
  begin
    inherited;
    DragAcceptFiles(Handle, false);
  
  end;
  
  procedure TForm1.WMDROPFILES(var msg: TWMDropFiles);
  var
    i, fileCount: integer;
    fileName: array[0..MAX_PATH] of char;
  begin
    fileCount:=DragQueryFile(msg.Drop, $FFFFFFFF, fileName, MAX_PATH);
    for i := 0 to fileCount - 1 do
    begin
      DragQueryFile(msg.Drop, i, fileName, MAX_PATH);
      Memo1.Lines.Add(fileName);
    end;
    DragFinish(msg.Drop);
  end;
  </code></pre>