Hola.. no soy un experto en esto, pero he estado probando (ahora que no me mira el jefe).code:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <ShellAPI.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
void TForm1::WMDropFiles(TMessage Mensaje)
{
char nombre[256];
String Extension;
DragQueryFile((HANDLE)Mensaje.WParam,0,nombre,255);
DragFinish((HANDLE)Mensaje.WParam);
ShowMessage(nombre);
RichEdit1->Lines->LoadFromFile(nombre);
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
DragAcceptFiles(Handle,true);
}
//---------------------------------------------------------------------------y el .h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TRichEdit *RichEdit1;
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void WMDropFiles(TMessage Mensaje);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_DROPFILES, TMessage,WMDropFiles)
END_MESSAGE_MAP(TComponent)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Espero que te sirva de inspiracion, no se si habre metido la gamba en algun lado.