查看单个帖子
旧 2009-05-04, 08:05 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】drag and drop in odamfcapp

drag and drop in odamfcapp
drag and drop in odamfcapp
hi,
i have modified the odamfcapp to support the drag n drop. as it only needs a few lines of code, maybe someone could integrate it in the official sample.
mainfrm.h insert at line 81:
code:
afx_msg void ondropfiles(hdrop hdropinfo);mainfrm.cpp insert at line 22:
code:
on_wm_dropfiles()mainfrm.cpp insert at line 71:
code:
dragacceptfiles(true);mainfrm.cpp insert at the end of file:
code:
void cmainframe:ndropfiles(hdrop hdropinfo)
{
int filenumber, index;
tchar filename[_max_path];
filenumber = dragqueryfile(hdropinfo, -1, filename, _max_path);
for(index = 0; index < filenumber; index++)
{
dragqueryfile(hdropinfo, index, filename, _max_path);
afxgetapp()->opendocumentfile(filename);
}
// release handle memory
dragfinish(hdropinfo);
}hope this helps
aur閘ien telmon
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)