Solved

How to drag drop in vb.net using ONLY windows API?

Posted on 2010-08-29
8
501 Views
Last Modified: 2012-05-10
Hi experts,

i would like to implement drag drop by only using windows API,
can anyone can help?

Thank you,

Kind Regards?
0
Comment
Question by:Dnx_7
8 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
?

What exactly do you mean by that?

...and how does the built-in drag/drop functionality not meet your needs?
0
 
LVL 2

Author Comment

by:Dnx_7
Comment Utility
Hi idle mind,

because we need  to intercept a dragged item from an external application...
we used the built-in drag drop .net but cannot detect what is the object dragged...

it is possible because another enterprise did it in C++

and the dragged item react on a Windows explorer windows...

so our possibilities are :

- simulate the windows explorer (like getting the handle and associate the handle to a form or panel... but don't really know if it is possible...à
- use the windows api drag drop to get the lower level and check the dragged item to analyze the object...


Thanks for your help,

Kind Regards
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
What application is the source of the drag drop?  What happens in explorer when that item is dropped?
0
 
LVL 2

Author Comment

by:Dnx_7
Comment Utility
The application is a specific application for broadcast systems...
when this application init a drag drop out of his environment, it only reacts in a windows explorer otherwise, nothing happens

we infer that if we simulate the explorer then we can do something with the dropped item...
or we guess that if we use the lowest level of the drag drop (windows api) then we can catch the dragged item and do things with this..
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
Did you try using the GetFormats() function in the DragEnter() event for you control?
http://msdn.microsoft.com/en-us/library/1745023c.aspx

    Private Sub Panel1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Panel1.DragEnter
        Dim formats() As String = e.Data.GetFormats

    End Sub

Or can you not get any drag/drop events to fire at all for your app when the source item is dragged over it?
0
 
LVL 8

Accepted Solution

by:
Gururaj Badam earned 250 total points
Comment Utility
0
 
LVL 27

Assisted Solution

by:Ark
Ark earned 250 total points
Comment Utility
>>when this application INIT a drag drop OUT of his environment, it only reacts in a windows explorer otherwise, nothing happens<<
Drag/Drop operations are DDE processes which are initialized by Shell, not any application. When you press left mouse button and move mouse ANYWHERE, shell creates drag object and inform underlined window that drag operations began. If application  that created window supports drag&drop (Explorer, for example or your VB app with AllowDrag=true) it fill Object data and data formats and tells shell about it (DoDragDrop). Shell store this info until you release mouse button and then inform windowunder cursor that Drop event occure (VB DragDrop event occure).
So, if drag/drop source/target is your application - you can use native VB. But as I understood, drag source is Explorer and drop target is another app, correct? Fortunately, Explorer place Drag object into clipboard when start draggin. So you need
1. Monitor mouse activity over target app drop window
2. When mouse enter window- query clipboard data and change it if necessary.
0
 
LVL 2

Author Closing Comment

by:Dnx_7
Comment Utility
Not really the solution but good to know
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now