c++ - Using a CListCtrl with Drag and Drop not working -
using visual studio 2017 trying enable drag , drop on clistctrl
, have added code such as:
on_wm_dropfiles() dragacceptfiles(); m_listctrl.dragacceptfiles(); void programnamehere::ondropfiles(hdrop hdropinfo) { cstring sfile; dword nbuffer = 0; // number of files dropped int nfilesdropped = dragqueryfile(hdropinfo, 0xffffffff, null, 0); (int = 0; i<nfilesdropped; i++) { // buffer size of file. nbuffer = dragqueryfile(hdropinfo, i, null, 0); // path , name of file dragqueryfile(hdropinfo, i, sfile.getbuffer(nbuffer + 1), nbuffer + 1); sfile.releasebuffer(); messagebox(pathfindfilename(sfile), pathfindfilename(sfile)); } // free memory block containing dropped-file information dragfinish(hdropinfo); cdialogex::ondropfiles(hdropinfo); }
i able working when drop file onto dialog anywhere when try , drop onto list control doesn't work.
would have idea doing wrong?
Comments
Post a Comment