How to enabled drag&drop from explorer to your window and retrieve a list of dropped files?
1. Enable your window (Form) to accept dropped files (DragAcceptFiles )
2. Add a message handler for WM_DROPFILES
3. Use DragQueryFile ( on WM_DROPFILES) to get the dropped files count and their full path.
[cpp]
//—————————————————————————
void __fastcall TForm1::FormCreate(TObject *Sender)
{
//enable drag&drop files
DragAcceptFiles(this->Handle,true);
}
//—————————————————————————
[/cpp]
[cpp]
class TForm1 : public TForm
{
__published: // IDE-managed Components
void __fastcall FormCreate(TObject *Sender);
private: // User declarations
void __fastcall WMDropFile(TWMDropFiles &Msg);
public: // User declarations
__fastcall TForm1(TComponent* Owner);
BEGIN_MESSAGE_MAP
//add message handler for WM_DROPFILES
VCL_MESSAGE_HANDLER(WM_DROPFILES, TWMDropFiles, WMDropFile)
END_MESSAGE_MAP(TComponent)
};
[/cpp]
[cpp]
//—————————————————————————
void __fastcall TForm1::WMDropFile(TWMDropFiles &Msg)
{
char filePath[MAX_PATH];
TStringList *FilesDroped=new TStringList();
//get dropped files count
int cnt=:
ragQueryFile((HDROP)Msg.Drop,0xFFFFFFFF,NULL,0);
//get dropped files path
for(int i=0;i
:
ragQueryFile((HDROP)Msg.Drop, i,filePath,MAX_PATH);
FilesDroped->Add(filePath);
}
ShowMessage(FilesDroped->Text);
delete FilesDroped;
}
[/cpp]

Programmers should be trusted. If your brain surgeon told you the operation you need takes five hours, would you pressure him to do it in three? 