Alfred

I am dropping files (one or more) on to a row in the grid and I need to know which row (or column) the files were dropped on. Here is as far as I got and I do not seem to be able to get the row number - just the active row:
procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
var
DropHandle : HDROP;
GlobalPoint, LocalPoint: TPoint;
n1, DroppedFileCount, FileNameLength: Integer;
DropPoint: TPoint;
FileName: String;
begin
// StringList1.Add('Msg.Message = $' + IntToHex(Msg.message, 4));
if Msg.Message = WM_DROPFILES then
begin
Handled := True;
DropHandle := Msg.wParam;
DroppedFileCount := DragQueryFile(DropHandle, $FFFFFFFF, nil, 0);
DragQueryPoint(DropHandle, DropPoint);
RowDroppedOn := ProfGrid1.Row;
if ((RowDroppedOn > 0) and (RowDroppedOn < (ProfGrid1.RowCount))) then
begin
for n1 := 0 to (DroppedFileCount - 1) do
begin
FileNameLength := DragQueryFile(DropHandle, n1, nil, 0);
SetLength(FileName, FileNameLength);
DragQueryFile(DropHandle, n1, PChar(FileName), FileNameLength + 1);
ShowMessage('RowDroppedOn=' + IntToStr(RowDroppedOn));
end; // n1 := 0 to (DroppedFileCount - 1)
end; // ((row > 0) and (row < StringGrid1.RowCount))
DragFinish(DropHandle);
end; // Msg.Message = WM_DROPFILES
end;