1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| Procedure TForm1.WMDropFiles (Var aMsg: tMessage); Var Idx, Size, FileCount: Integer; Filename: pChar; Begin Inherited;
FileCount := DragQueryFile (aMsg.WParam, $FFFFFFFF, nil, 255); For Idx := 0 To FileCount -1 Do Begin Size := DragQueryFile (aMsg.WParam, Idx, nil, 0) + 1; Filename := StrAlloc (Size); If DragQueryFile (aMsg.WParam, Idx, Filename, Size) = 1 Then ;
ListBox1.Items.Add (pChar (Filename)); StrDispose (Filename); End;
DragFinish (aMsg.WParam); End; |