Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and drop in winapi

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?

like image 860
Peter Olsson Avatar asked Oct 10 '08 09:10

Peter Olsson


1 Answers

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.

like image 67
macbirdie Avatar answered Oct 21 '22 07:10

macbirdie