1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
void CTestDlg::OnDropFiles(HDROP hDropInfo) { // TODO: Add your message handler code here and/or call default UINT count; char filePath[200]; count = DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0); if(count) { for(UINT i=0; i<count; i++) { int pathLen = DragQueryFile(hDropInfo, i, filePath, sizeof(filePath)); AfxMessageBox(filePath); } } DragFinish(hDropInfo); CDialog::OnDropFiles(hDropInfo); } |
转载请注明:exchen's blog » VC 实现文件拖拽