在winapi中拖放 [英] Drag and drop in winapi

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

问题描述

我有一个纯Winapi应用程序需要一些新功能。其中一个最好被实现为两个列表,您可以在列表之间拖放(多个)元素。新功能可以限制在单个对话框中。



实现这一点的最快方法是什么?
几个想法:




  • 纯Winapi(是DetectDrag)

  • MFC或.NET DLL提供此一个对话框

  • 嵌入Microsoft WebBrowser控件并使用JQuery



任何应该避免的选项?

任何更好的想法?

什么是最快实现?

有关如何开始的任何指针?

解决方案

我的建议是,如果应用程序是纯winapi,请保持这样。



启动一个.NET框架运行时,只需一个可拖动项目的对话框就像托管一个WebBrowser控件一样糟糕,并且使用JQuery来实现这一功能 - 如果你问我(至少是thedailywtf.com)但是再一次,你不是问我,))。



否则你会把自己(和潜在的其他人)变成一些可维护的噩梦,最快的方式将成为最有问题的一个。



编辑:可能那些< a> 两篇文章将有助于实施拖放 - 他们关于ListViews中的行重排序,但可能有助于获取想法。


I have a pure Winapi application that needs a few new features. One of them would best be implemented as two lists where you can drag-and-drop (multiple) elements between the lists. The new feature can be limited to a single dialog.

What would be the quickest way to implement this? A few ideas:

  • Pure Winapi (is it DetectDrag)
  • A separate MFC or .NET DLL that provides this one dialog
  • Embed the Microsoft WebBrowser Control and use JQuery

Any of these options that should be avoided?
Any better ideas?
What is quickest to implement?
Any pointers on how to get started?

解决方案

My advice would be that if the application is in pure winapi, keep it that way.

Starting a .NET framework runtime just for one dialog with draggable items is as bad as hosting a WebBrowser control and using JQuery for that one functionality - it's at least thedailywtf.com-worthy if you ask me (but then again, you're not asking me ;) ).

Otherwise you will put yourself (and potentially others) into some maintainability nightmare and the quickest way will become the most problematic one.

Edit: Maybe those two articles will help in implementing drag-drop - they're about row reordering in ListViews, but will probably help in getting the idea.

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

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