Move the file and display the file path in the edit box

Source: Internet
Author: User

This chapter we is study how to get the path of file by using drag drop.

Here is the code, enjoy:

1 voidcfilecrcdlg::ondropfiles (hdrop hdropinfo)2 {3     //todo:add your message handler code here and/or call default4 UINT I,ifilecount;5     CharFile_name[max_path];6Ifilecount=::D ragqueryfile (Hdropinfo,0xFFFFFFFFNull0);7      for(i=0; i<ifilecount;i++)8     {9         if(i==0)Ten         { One ::D ragqueryfile (Hdropinfo,i,file_name,max_path); A Setdlgitemtext (idc_edit1_path,file_name); -         } -         Else  the         { - ::D ragqueryfile (Hdropinfo,i,file_name,max_path); - Setdlgitemtext (idc_edit2_crc_hex,file_name); -         } +     } - ::D ragfinish (hdropinfo); + cdialog::ondropfiles (hdropinfo); A}

Thank you!

Move the file and display the file path in the edit box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.