title: WMDropFiles problem on win7
body: <p>I've implemented the following procedure and it works properly when I compile it on my computer running windows vista, computer #1. If I share the created .exe file to another computer running win7, computer #2, it runs fine aswell. The problem is when I let the computer #2 compile it, it wont simply recognize that anything's dropped on the application. There's no response at all in this code. It's built and compiled without errors or warnings. 
  I've been searching the net for a while without finding anything that explains why this happens or someone else with this problem. </p>
  
  <p>Both computers use Delphi 2010 with the same components installed. </p>
  
  <ol>
  <li>Is this the way to go to allow the user to drop files onto the application? If not, how should it be done nowdays?</li>
  <li>Any ideas why it works when it's compiled on computer #1 but not computer #2? (The program works properly on both computers when compiled on computer #1)</li>
  </ol>
  
  <p>Any help or comment is highly appreciated.</p>
  
  <pre><code>procedure TfMainForm.WMDROPFILES(var msg: TWMDropFiles);
  const
    MaxLength = 255;
  
  var
    nFiles : integer;
    i : integer;
    fileName : array [0..MaxLength] of char;
    fileNames : TStringArray;
  
  begin
    // Get number of files dropped
    nFiles := DragQueryFile(msg.Drop,  $FFFFFFFF, fileName, MaxLength);
  
    // Get filenames
    SetLength(fileNames, nFiles);
    for i := 0 to nFiles - 1 do begin
      DragQueryFile(msg.Drop, i, fileName, MaxLength);
      fileNames[i] := fileName;
    end;
  
      // Add files
    projectHandler.addFiles(fileNames);
  
    //release memory
    DragFinish(msg.Drop);
  end;
  </code></pre>