MFC + MDI文件拖拽功能
来源:互联网 发布:ansys仿真软件价格 编辑:程序博客网 时间:2024/05/18 00:29
第一步:
首先在int CXXXView::OnCreate(LPCREATESTRUCT lpCreateStruct)中添加this->DragAcceptFiles();
第二步:
打开类向导
添加WM_DROPFILES消息
第三步:
在OnDropFiles函数中接收文件路径
void CxxxView::OnDropFiles(HDROP hDropInfo)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
//Add
int DropCount = DragQueryFile(hDropInfo, -1, NULL, 0); // 取得文件数量 When the function copies a file name to the buffer, the return value is a count of the characters copied, not including the terminating null character.
for(int i = 0; i < DropCount; i++) // 遍历
{
TCHAR strFileName[MAX_PATH];
DragQueryFile(hDropInfo, i, strFileName, MAX_PATH); // 获得文件名(包含路径) Retrieves the names of dropped files that result from a successful drag-and-drop operation.
theApp.OpenDocumentFile(strFileName); // 打开文件
}
DragFinish(hDropInfo); // 释放内存 Releases memory that the system allocated for use in transferring file names to the application.
CScrollView::OnDropFiles(hDropInfo);
}
- MFC + MDI文件拖拽功能
- MFC实现文件拖拽功能
- MFC MDI 打开文件的调用过程
- MFC MDI
- MFC单个控件实现文件拖拽功能
- MFC单文档实现文件拖拽功能
- 对于MFC中窗口接受文件的拖拽功能
- VS2012 MFC 对话框支持文件拖拽功能
- MFC中窗口实现拖拽文件功能
- MFC文件拖曳功能
- MFC MDI 全屏
- MFC MDI 全屏实现
- MFC MDI
- MFC 相关MDI
- MFC MDI 工程禁用win7任务栏(taskbar)多视图缩略图(preview)功能
- MFC对象拖拽功能(不只是文件拖拽)(转)
- ogre+MFC+MDI错误集
- MFC MDI GetActiveView() 为空
- 【日常学习】乘法逆元&&欧拉定理&&费马小定理&&欧拉函数应用&&常大学霸
- 使用fuel 6.0 部署openstack Juno 版本
- 【shell】ps 结合grep查找时,去掉grep自身匹配的那行
- GA/GP中的适应度函数
- 查看APK的版本信息
- MFC + MDI文件拖拽功能
- Go实践
- Quagga 简介及Quagga使用基础谈用Quagga配置RIP路由协议
- GRE作文提纲在写作中是很重要的
- My Standard Code Library
- Java学习篇之---json-lib(Maven)
- [leetcode] Integer to Roman
- 学习Ocaml--(1)基本概念
- perl 批量监控主机ping