how would i do this?

i know u use this api ("Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Integer, ByVal yPoint As Integer) As IntPtr") for getting window from the cursor pos but how about a filename?

wat im trying to do is make a program that u put ur cursor over an icon u want and hit a button to extract it.

if this isnt possible how would i do drag and drop.