1. InitInstance()
m_pMainWnd-> DragAcceptFiles();
2. header
afx_msg void OnDropFiles(HDROP hDropInfo);
3. BEGIN_MESSAGE_MAP
ON_WM_DROPFILES()
4. OnDropFiles(HDROP hDropInfo)
const int cnt = DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
char filename[MAX_PATH];
for(int i=0; i<cnt; i++){
DragQueryFile(hDropInfo, i, filename, MAX_PATH);
}
DragFinish(hDropInfo);
5. 相關函數
BOOL DragQueryPoint(
HDROP hDrop,
LPPOINT lppt
);
全站熱搜