在应用程序中拖放到另一个应用程序 [英] Drag/Drop inside an Application AND to another Application

查看:50
本文介绍了在应用程序中拖放到另一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含文件名的 ListView.这些文件名需要可拖动到 TreeView,它是应用程序内的拖放功能,并与 Delphi 的内置拖放支持一起使用 - 没问题.但我还必须能够将 ListView 项目拖放到另一个应用程序,例如Windows资源管理器.这也有效,例如使用 Anders Melander 的组件套件 (http://melander.dk) 的 DragFileSource 组件它在 ListView.MouseDown 事件中工作,因此实际上并没有启动拖放操作.

I have a ListView containing file names. These file names need to be draggable to a TreeView, which is a drag/drop inside the application and works with the built in drag/drop support of Delphi - no problem. But I must also be able to drag/drop the ListView items to another application, e.g. Windows Explorer. This also works, for example using a DragFileSource component of Anders Melander's Component Suite (http://melander.dk) which start its work in the ListView.MouseDown event, so there is not really a drag/drop operation initiated.

基本上,我需要与您在 Windows 资源管理器中看到的相同的行为:您可以将项目拖动到应用程序内的另一个文件夹,也可以拖动到另一个应用程序.

Basically, I would need the same behaviour as you can see in a Windows Explorer: You can drag an item to another folder inside the application and also to another application.

如何在 Delphi 中做到这一点?我想应该有一个拖动"启动,但是当鼠标移出应用程序窗口时,它需要切换"到其他功能,并且如果鼠标移回应用程序窗口,再次回到标准拖放.

How can this be done in Delphi? I guess there should be a "drag" initiated, but when the mouse moves outside the app window, it needs to "switch" to the other functionality, and should the mouse move back to the app window, again back to the standard drag drop.

感谢您的帮助!

霍尔格

推荐答案

你提到的 Drag and Drop Component Suite 可以这.您可以启动拖动,默认情况下您可以将其拖放到您自己的应用或其他应用中.只需选择其他应用程序可以理解的正确剪贴板格式.你有什么问题?

The Drag and Drop Component Suite you mentioned does this. You can initiate a drag which you can drop in your own app or other apps by default. Just pick the right clipboard format that other applications understand. What is your problem with it?

这篇关于在应用程序中拖放到另一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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