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

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

问题描述

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



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



如何在Delphi中完成?我猜应该有一个拖动启动,但是当鼠标移动到应用程序窗口外面时,它需要切换到其他功能,如果鼠标移回到应用程序窗口,再次回到标准的拖放



感谢任何帮助!



Holger

解决方案

您提到的拖放组件套件会这样做。默认情况下,您可以启动一个可以放在自己的应用程序或其他应用程序中的拖动。只需选择其他应用程序理解的正确的剪贴板格式。你有什么问题吗?


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 it's work in the ListView.MouseDown event, so there is not really a drag/drop operation initiated.

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.

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.

Thanks for any help!

Holger

解决方案

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?

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

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