Drag and Drop from Windows Compress Files

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

37 Replies - 6939 Views - Last Post: 27 June 2014 - 06:40 PM Rate Topic: -----

#1 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Drag and Drop from Windows Compress Files

Posted 25 June 2014 - 01:44 PM

I've been looking for some examples of handling dropped files from within a Windows compressed folder? I suspect, ultimately I may need to identify that it is a compressed folder and extract the contents, however I have not been able to find any information about identifying the file that may have been drug out of the folder onto the form (such as the file name, zip file path etc)

Any help would be appreciated.

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Drag and Drop from Windows Compress Files

#2 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,995
  • Joined: 05-May 12

Re: Drag and Drop from Windows Compress Files

Posted 25 June 2014 - 07:18 PM

What are you currently getting as the drop target? What is the list of data formats provided by the drag source?
Was This Post Helpful? 0
  • +
  • -

#3 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:17 AM

View PostSkydiver, on 25 June 2014 - 07:18 PM, said:

What are you currently getting as the drop target? What is the list of data formats provided by the drag source?


I'm not sure, and to be honest I'm not entirely sure how to get that information. I'm more than happy to do the work if you can point me in the direction of how to get that info for you.

Thanks!
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,995
  • Joined: 05-May 12

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:30 AM

So in short, you haven't tried anything yet and you wanted us to do the research for you?
Was This Post Helpful? 1
  • +
  • -

#5 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:34 AM

View PostSkydiver, on 26 June 2014 - 06:30 AM, said:

So in short, you haven't tried anything yet and you wanted us to do the research for you?


No, in short, I don't know HOW to get the information your asking. I'm more than happy to do it, however it is not something I know how to do.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,995
  • Joined: 05-May 12

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:38 AM

View Postdarkman738, on 25 June 2014 - 04:44 PM, said:

I've been looking for some examples of handling dropped files from within a Windows compressed folder?


And there lies the problem... you were looking for prepackaged code instead of learning how the system works first. I recommend reading how things work first: Drag-and-Drop Operations and Clipboard Support

In one of the sections is about interrogating the source about what formats it is offering up.
Was This Post Helpful? 0
  • +
  • -

#7 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:39 AM

Well, the best place to start is the same place you'd start handling drag-and-drop for regular files. Set up a test project and search "C# drag drop files". Work your way through it, but once you get it working, place a breakpoint in the logic and see what happens when you drop a compressed file. From there, you should get some idea of what you have to work with. That should either show you what you need to do, or give you more information to search on.

Remember, this forum requires effort to be shown on the part of the asker. We're not just giving you a hard time; it's a requirement here, because our goal isn't to solve a problem, but to help people become better programmers.
Was This Post Helpful? 0
  • +
  • -

#8 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:49 AM

View PostCurtis Rutland, on 26 June 2014 - 06:39 AM, said:

Well, the best place to start is the same place you'd start handling drag-and-drop for regular files. Set up a test project and search "C# drag drop files". Work your way through it, but once you get it working, place a breakpoint in the logic and see what happens when you drop a compressed file. From there, you should get some idea of what you have to work with. That should either show you what you need to do, or give you more information to search on.

Remember, this forum requires effort to be shown on the part of the asker. We're not just giving you a hard time; it's a requirement here, because our goal isn't to solve a problem, but to help people become better programmers.



Ok, so to start with, I have been able to handle drag and drop from normal files, it's simply when dragging from inside a compressed folder that my issue occurs. I have done the above, but I, for one am not entirely sure what I am looking for, and two don't see anything any different from a normal file from what I can see. I cannot find any information or documentation from anyone at all about doing anything with compressed folders other than extracting them. Which, ultimately may be what I have to do and that is fine, except I can't find anything that gives some information about them.
Was This Post Helpful? 0
  • +
  • -

#9 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 06:57 AM

View PostSkydiver, on 26 June 2014 - 06:38 AM, said:

View Postdarkman738, on 25 June 2014 - 04:44 PM, said:

I've been looking for some examples of handling dropped files from within a Windows compressed folder?


And there lies the problem... you were looking for prepackaged code instead of learning how the system works first. I recommend reading how things work first: Drag-and-Drop Operations and Clipboard Support

In one of the sections is about interrogating the source about what formats it is offering up.


No, I'm not looking for a prepackaged code, I am however looking for information about something I have not been able to find anywhere else. I have read through your link already with no mention of handling compressed folders. I'm really not sure why people insist on this type of elitist attitude when clearly people come here for assistance. I'm a hobbyist at best, development is not my job, nor am I interested in becoming on full time, I'm simply looking for a solution to a problem turning to an open forum with people who presumably want to help the community by sharing knowledge, not berating people who have less experience/knowledge than you. If your unwilling to help someone who clearly states they are ignorant of your question then you should keep your comments to yourself.

View Postdarkman738, on 26 June 2014 - 06:49 AM, said:

I can't find anything that gives some information about them.


More accurately I can't find any information about handing them, or retrieving information in a drag/drop scenario.
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,995
  • Joined: 05-May 12

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 07:10 AM

The link I provided above was a general explanation of how drag/drop works and the intent was for you to do the research. It was not intended to just spoonfeed you the answer of how to deal with compressed files.

Since you want to be spoonfed, here's the data format that you seek based on a SO answer: http://stackoverflow.com/a/5991432
Was This Post Helpful? 0
  • +
  • -

#11 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 07:26 AM

View PostSkydiver, on 26 June 2014 - 07:10 AM, said:

The link I provided above was a general explanation of how drag/drop works and the intent was for you to do the research. It was not intended to just spoonfeed you the answer of how to deal with compressed files.

Since you want to be spoonfed, here's the data format that you seek based on a SO answer: http://stackoverflow.com/a/5991432


Thanks, I did read that, and I'm not looking to be spoon fed. However that is C++, and I'm not really sure how to use this in my C# project. I will read into this, however hopefully I do something with this info.

Much appreciated.
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15268
  • View blog
  • Posts: 61,212
  • Joined: 12-June 08

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 07:43 AM

Quote

I have read through your link already with no mention of handling compressed folders.


I think the problem is your are not breaking the problem down. You are looking for a packaged solution to fit your entire need, oui? Most often, in programming, that is not the case and one would have to break the problem down into manageable pieces and stitch a solution together. Much like legos. Man I would totally love to build complex architectural wonders, but to get there I need to build up specific areas that I may not have a solid piece for.

Your problem is two folk.
1. Get the form to recognize something is being dragged on to it.
2. Deal with what ever you want to do with a compressed file.

You need to focus one, but not necessarily both. This means you'll find solutions on how to deal with drag and drop of other things, ignore the fact they are not about compressed files, examine those solutions, and realize the actions they are needed.

In that link ( http://msdn.microsof...v=vs.71%29.aspx ) there's a section called "Performing Drag-and-Drop Operations in Windows Forms". Look at it. See how they are doing the action with their examples. Again, ignore this is not exactly about a compressed file, and study the action knowing this is a step to your solution.

Open up you view and see that one stop solutions are not the only thing to use. The world is an imperfect place with problems that require creative solutions not written down. The whole "spoonfed" commentary is to draw your attention that, some days, you will not find a step by step fix for your very specific problem. What you will find is if you break the problem down you can research steps that, when combined, create the megazord. Er.. I mean create the solution you are after.
Was This Post Helpful? 0
  • +
  • -

#13 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 08:01 AM

View Postmodi123_1, on 26 June 2014 - 07:43 AM, said:

Quote

I have read through your link already with no mention of handling compressed folders.


I think the problem is your are not breaking the problem down. You are looking for a packaged solution to fit your entire need, oui?


No, it would be great to have something from someone that says "hey, I've done this before, here is how" but I'm ok with having to piece things together.

View Postmodi123_1, on 26 June 2014 - 07:43 AM, said:

Quote

I have read through your link already with no mention of handling compressed folders.


Most often, in programming, that is not the case and one would have to break the problem down into manageable pieces and stitch a solution together.


I'm fully aware, which is why my question was targeted at handling compressed folders not how to handle drag and drop on a form.

View Postmodi123_1, on 26 June 2014 - 07:43 AM, said:

Quote

I have read through your link already with no mention of handling compressed folders.


This means you'll find solutions on how to deal with drag and drop of other things, ignore the fact they are not about compressed files, examine those solutions, and realize the actions they are needed


As I stated before, I can handle dropping files without an issue. The basics are already there, its more detail/information that I am missing.

Thanks for the input.
Was This Post Helpful? 0
  • +
  • -

#14 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15268
  • View blog
  • Posts: 61,212
  • Joined: 12-June 08

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 08:04 AM

Quote

I'm fully aware, which is why my question was targeted at handling compressed folders not how to handle drag and drop on a form.

Did I miss where you indicated you were able to operate the drag and drop sufficiently to get a path or the compressed file?

Elaborate on what "handling compressed folders" means. That could be a multitude of operations.
Was This Post Helpful? 0
  • +
  • -

#15 darkman738   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 14

Re: Drag and Drop from Windows Compress Files

Posted 26 June 2014 - 08:37 AM

Quote

I have been able to handle drag and drop from normal files, it's simply when dragging from inside a compressed folder that my issue occurs.


I may not have been clear in my initial post but yes I did mention I can pickup the dropped files. Currently I'm just grabbing the file name and path which is blank obviously when dragging out of a compressed file. I suspect what I will need to do is get the file name of the file being drug into the form and the path to the compressed file then extract the file that was intended into a temp path. I'm fine with this approach and can handle everything in that list except finding a way to identify that the drop is from inside a compressed file, and how to get the file name and path to the actual compressed file. Another possible issue is that this may be from Outlook, which I am already able to handle when the file is not compressed. I'm not sure that would actually matter as Outlook still needs to save the file locally so I should be able to grab and at least copy it myself to a temp directory to work with, but I thought I'd mention that as well. However, to start with, handling files from inside a compressed folder using Windows Explorer excluding the scenario of an Outlook attachment is fine.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3