Procedure Tfm_main.DragDropFiles(Var message: TMessage);
Var
p: Array[0..254] Of char;
i: Word;
Begin
Inherited;
i := DragQueryFile(Message.wParam, $FFFFFFFF, Nil, 0);
For i := 0 To i - 1 Do
Begin
DragQueryFile(Message.wParam, i, p, 255);
End;
Try
If FileExists(strPas(p)) Then
OpenFile(strPas(p));
Finally
DragFinish(HDROP(Message.WParam));
End;
End;