How to open a file when dragging the window?

To simplify the workflow, wrote a translator. Works just:
The window for entering the markup
4 buttons for 4 types of processing
The output window of code.
When you want to process one file - everything is simple, but when you have to handle 7-8 with constant edits from the customer, spent a lot of time.
Actually the question.

How to teach the application to obtain the contents of the file when dragging it into the application window?
August 19th 19 at 23:32
1 answer
August 19th 19 at 23:34
A simple way To allow form AllowDrop and catch the DragDrop event. In its properties is a description of what you throw.

Complicated way: for starters read this
It describes the implementation in Delphi, but the steps are the same.
You need to describe all the functions which are used via DllImport. To Call DragAcceptFiles.
To override the Wndproc for the form protected override void WndProc(ref Message m), and is there to handle the event a wm_dropfiles and using DragQueryFile to the passed list.

Find more questions by tags C#User interfaceVisual Studio