典型的 Win32 文件删除 (IDropTarget::Drop) 实现? [英] Typical Win32 file drop (IDropTarget::Drop) implementation?

查看:21
本文介绍了典型的 Win32 文件删除 (IDropTarget::Drop) 实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在没有 MFC 的情况下用 C++ 制作一个类似于 Windows 资源管理器的程序.

I am trying to make a Windows Explorer-like program in C++ without MFC.

它有一个列表视图,显示文件系统目录和文件.

It has a list view which shows the file system directories and files.

我想为列表视图添加放置目标功能,

I want to add the drop target functionality for the list view,

所以我实现了 IDropTarget 接口并注册了 hwnd.

so I implemented IDropTarget interface and registered the hwnd.

使用IDropTargetHelper,我简单地实现了想要的拖放效果在 DragEnter、DragOver、DragLeave 方法中.

With IDropTargetHelper, I simply achieved the desired drag&drop effect in DragEnter, DragOver, DragLeave method.

但在 Drop 方法中,dropTargetHelper 无能为力.

But in Drop method, the dropTargetHelper was helpless.

我的列表视图只接受文件删除.

My list view only accepts File drops.

我是否应该自己实现删除文件的 COPY、MOVE、LINK 操作?

Should I implement the dropped files' COPY, MOVE, LINK operation for myself?

或者是否有一个简单的 shell 文件操作助手来接受删除的 IDataObject?

OR is there a simple shell file operation helper which accepts dropped IDataObject?

我知道如何从放置的对象中获取文件名,而且文件复制很容易.

I know how to get filenames from the dropped object, and just file copying is easy.

但我想也许还有更多的事情需要考虑:例如,制作文件链接、源项目是虚拟的等等.

But I think maybe there are more things to consider: for example, making a file link, source item is virtual, and so on.

所以我想知道是否有 Windows shell 中可用的辅助方法.

So I wonder if there are helper methods available from Windows shell.

推荐答案

教科书示例将来自 MSDN.请阅读旧的新事物文章 12.

The textbook example would be the one from MSDN. Do read Old New Thing articles 1 and 2.

这篇关于典型的 Win32 文件删除 (IDropTarget::Drop) 实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆