下个VCL吧,它支持:
http://www.melander.dk/delphi/dragdrop/

解决方案 »

  1.   

    不怕麻烦,可以不用VCL,自己做。看看这个:
    Drag and Drop with Files - by Borland Developer Support Staff Question and Answer DatabaseFAQ529D.txt   Drag and Drop with Files
    Category   :Windows API
    Platform    :All
    Product    :All 32 bit  Question:
    How do I accept files that are dropped on my application?
    Answer:
    You must interface with the Windows Shell API module to let
    Windows know that your application accepts dropped files (this
    can be done in your main form's create event), and then you must
    respond to the drag events as they happen by creating an event
    handler.The following is an example of a Delphi form that accepts dropped
    files and adds the names of the files to a memo component:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Memo1: TMemo;
        procedure FormCreate(Sender: TObject);
      private
        procedure WMDROPFILES(var Message: TWMDROPFILES);
          message WM_DROPFILES;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}uses ShellApi;procedure TForm1.FormCreate(Sender: TObject);
    begin
     {Let Windows know we accept dropped files}
      DragAcceptFiles(Form1.Handle, True);
    end;procedure TForm1.WMDROPFILES(var Message: TWMDROPFILES);
    var
      NumFiles : longint;
      i : longint;
      buffer : array[0..255] of char;
    begin
     {How many files are being dropped}
      NumFiles := DragQueryFile(Message.Drop,
                                -1,
                                nil,
                                0);
     {Accept the dropped files}
      for i := 0 to (NumFiles - 1) do begin
        DragQueryFile(Message.Drop,
                      i,
                      @buffer,
                      sizeof(buffer));
        Form1.Memo1.Lines.Add(buffer);
      end;
    end;end.7/16/98 4:31:28 PM
      

  2.   

    我的意思就是比如我想做一个文件改名的程序,直接把想要改名的文件拖到窗体上,然后edit1就会显示出文件名来ether(void),你给的代码在delphi5.0下不通过在NumFiles := DragQueryFile(Message.Drop,-1,nil,0);
      

  3.   

    我也写过这样的组件,是一个listbox,你可以到我的主页下载源代码:http://www.sunistudio.com/download/df_lb.zip
    (有说明)或者看我写的文章:
    http://www.sunistudio.com/asp/sunidoc.asp?act=-2&article=113
    《自制支持文件拖放的VCL组件》