{How to support file drag and drop support file drag and drop in the Delphi program is two points: 1. Enable the program to receive WM_DROPFILES messages; Make the program to receive WM_DROPFILES messages First, you need to call WinAPI DragAcceptFiles (Handle, True); Handle is a handle of the control to receive the WM_Dropfiles message. For example, we want MEMO1 to receive the message, then call the form to DragAcceptFiles (Form1.Memo1.Handle, True); Second, you want to do it when you receive a WM_DropFiles message, you need to replace the WindowProc method for this control with your own code. Before replacing, save the original WindowProc approach to handle additional messages. To do this, we define a full variable OldWndProc: twwndMethod saves the original WindowProc method; then defines a method Procedure DragfileProc (Var Message: TMessage); as a new WindowProc method; Write the full code of DragfileProc within the Unit's IMplementation segment, which is handled when the message calls the OldWndProc when the message is WM_DropFiles, is processed. Take the file name dragged and then processed in response to the WM_DROPFILES message, first call the total number of files that DragQueryFile (Message.WParam, $ ffffff, nil, 0) is dragging. Recycling DragQueryFile (Message.WParam, I, BUF, LEN); obtain a full name of the drag and drop file. I is 0 to drag and drop the total number of files minus 1, BUF is a PCHAR type, which is a buffer that stores the file name, and LEN is the length of the file name buffer. As for the processing after the file name, I have listened to the respect.