Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-08-29
8
Medium Priority
?
536 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33553941
?

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
ID: 33554000
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 86

Expert Comment

by:Mike Tomlinson
ID: 33554266
What application is the source of the drag drop?  What happens in explorer when that item is dropped?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 2

Author Comment

by:Dnx_7
ID: 33554402
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
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33554442
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 750 total points
ID: 33556828
0
 
LVL 28

Assisted Solution

by:Ark
Ark earned 750 total points
ID: 33573824
>>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
ID: 33930042
Not really the solution but good to know
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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