Dialog implementation file drag and drop

Man of few words said, directly on the code:

 1 void C目录选择对话框Dlg::OnDropFiles(HDROP hDropInfo)
 2 {
 3     TCHAR szPath[MAX_PATH] = { 0 };
 4     UINT nCount =  DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
 5     for (size_t i = 0; i < nCount; i++)
 6     {
 7         DragQueryFile(hDropInfo, i, szPath, MAX_PATH);
 8         MessageBox(szPath);
 9     }
10     DragFinish(hDropInfo);
11     CDialogEx::OnDropFiles(hDropInfo);
12 }

Guess you like

Origin www.cnblogs.com/mktest123/p/12124144.html