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
);

arrow
arrow
    全站熱搜

    edisonx 發表在 痞客邦 留言(0) 人氣()