Jim Kring Posted May 22, 2008 Report Share Posted May 22, 2008 [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? Thanks, -Jim Quote Link to comment
MikaelH Posted May 22, 2008 Report Share Posted May 22, 2008 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 Quote Link to comment
T_Schott Posted May 22, 2008 Report Share Posted May 22, 2008 Hi, i use the following events to check the file content: Drag Starting? (alligned to the source) Drag Enter? (alligned to the target) Drop? (alligned to the target) Quote Link to comment
Jim Kring Posted May 22, 2008 Author Report Share Posted May 22, 2008 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 Quote Link to comment
T_Schott Posted May 23, 2008 Report Share Posted May 23, 2008 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.