Tell everyone that everything is okay for the three API functions ....
Dragacceptfiles, dragqueryfile, and dragfinish.
The following is my simple implementation ..
I created an MFC project .. The Interface contains a ListBox .. Member variable: m_list.
Add: This-> dragacceptfiles (true) in oninitdialog );
Add a wm_dropfiles message to this dialog box ..
Message Processing functions:
Void cdrayfilesdlg: ondropfiles (hdrop hdropinfo) {// todo: add the message processing program code and/or call the default uint ufilenum =: dragqueryfile (hdropinfo, 0 xffffffffff, null, 0); wchar strfilename [max_path]; for (INT I = 0; I <ufilenum; I ++) {: dragqueryfilew (hdropinfo, I, strfilename, max_path ); cstring STR (strfilename); m_list.addstring (STR + "\ r \ n"); }:: dragfinish (hdropinfo); cdialogex: ondropfiles (hdropinfo );}
In this way, you can implement the drag function .. I didn't expect it to be that simple ..
Effect: