Programming - cpueblo.com

Drag & Drop 예제 - DragQueryFile()


글쓴이 : 유광희 날짜 : 2002-05-13 (월) 16:44 조회 : 19198
Drag & Drop 예제 //=============================================== // WM_DROPFILES // // //=============================================== void CNcTestDlg::OnDropFiles(HDROP hDropInfo) { DWORD dwDropNum, dwBufSize, i; LPTSTR szFile; CString sFile;//, sExt; if ( !m_Nc.IsLoaded() ) { AfxMessageBox(_T("Cannot find Nc.DLL !!") ); CDialog::OnDropFiles(hDropInfo); return; } DoReset(); dwDropNum = ::DragQueryFile(hDropInfo,0xffffffff,NULL,0); for ( i=0; i<dwDropNum; i++ ) { dwBufSize = ::DragQueryFile (hDropInfo, i, NULL, 0) + 1; szFile = (TCHAR*)new TCHAR [dwBufSize]; ::DragQueryFile (hDropInfo, i, szFile, dwBufSize); sFile=szFile; delete[] szFile; if ( AcceptFile(sFile) ) { DoDetect(); //DoCheck(); // ErrorX // break; } } CDialog::OnDropFiles(hDropInfo); } &lt;/XMP> </div> <!-- 테러 태그 방지용 --></xml>