Jump to content

Is there any way to get file drag events on a File Path control?


Recommended Posts

[cross-post]

I want to be able to detect that a user has draged a file into a path control, before they actually drop it. I can get the drop event, via that Value Changed event for the path control, but I need to know about the file path before they actually drop it (i.e., drag enter/over). Is there any way to do this? Perhaps by using some Windows API functions?

post-17-1211326418.png?width=400

Thanks,

-Jim

Link to comment

Hi Jim

I had these problems when adding drag support from the Project Tree to my UML modeller.

I had to solve it by using the Input Device Control VIs.

This code will do the first part: -Know when the move is over the Path Control.

Download File:post-941-1211341397.vi

-The next should be to check if the button was pressed, when you entered the VI (drag started outside VI)

-Check for button released.

-Then you'll get the Path-Value change event.

But of cause you like to check the content of the dragged file before, the user releases.

E.g. Flag that the file has the wrong format and can't be dropped here.

I guess you have to use some windows API to get the content of the dragged file.

Good luck,

//Mikael

Link to comment

Mikael,

Thanks for the response.

> I guess you have to use some windows API to get the content of the dragged file.

Yes, that's the missing link.

T_Schott,

> i use the following events to check the file content:

Thanks for posting your solution. However, this is using a listbox as the drag source -- I'm interested in using Windows File Explorer (the OS) as the drag source.

Cheers,

-Jim

Link to comment

QUOTE (Jim Kring @ May 21 2008, 03:55 PM)

> i use the following events to check the file content:

Thanks for posting your solution. However, this is using a listbox as the drag source -- I'm interested in using Windows File Explorer (the OS) as the drag source.

-Jim

Well, I build my own "file explorer" - using the listbox

-timo

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.