This is a default behavior in windows. It will simply start your program with the first parameter of the command line being the path to the file that was dragged on top of the icon.
See this article[
^] about parsing command line parameters. Once you have the file name (or names if multiple files were dragged on), then you can do whatever you want with it.