You can either:
1. Handle the HDROP pointer to a DROPFILES structure that comes as a parameter in your OnDropFile() function. See
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773269%28v=vs.85%29.aspx[
^]
You can then make a hit test between your textboxes coordinates and the pt POINT of the DROPFILEs structure to find in which it has landed.
See also:
How to Implement Drag and Drop Between Your Program and Explorer[
^]
2. Or, instead of handling the drop event in the main window, as I suppose you did, you might handle it in the textbox classes.
On a side note, I am surprised you are mixing plain Win32 (SetDlgItemText) and MFC code (OnDropFile())...