1

I use Visual Studio 2010 C++, what is the easiest way to unzip a file? Windows itself must have the functionality somewhere inside, ever since XP Windows got its own unzip wizard.

Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
  • 1
    You're correct that this functionality is available in Windows by default, but that doesn't mean using that will be the simplest way, especially if the functionality may not be enabled on the end user's system (some compression programs install themselves in a way that breaks the Windows default handlers). I think you'll end up needlessly complicating something that would be trivial with any number of third-party tools or libraries. –  Sep 15 '13 at 20:22
  • So... "How do I unzip a zip-format file using only native Win32 APIs (XP) ? The current title doesn't go near-far enough to reflect the question restrictions (and C++ shouldn't be there anyway as it is in the tag-list). And regardless, this isn't the proper form of question for this forum. – WhozCraig Sep 15 '13 at 20:22

2 Answers2

5

Have a look at Rich Geldreich's miniz. It's not winapi specific but it's so an easy way to add ZIP support to your application.

Gregory Pakosz
  • 69,011
  • 20
  • 139
  • 164
  • 1
    You should add your answer to http://stackoverflow.com/questions/12011723/zip-and-unzip-file-c in case my (admittedly not excellent) question is closed. Rich Geldreich's miniz is clearly a work of art. – Prof. Falken Sep 15 '13 at 20:49
  • I tried a couple of the other answers to that other question, but they crashed or would not link. That's probably my fault, but Miniz was so simple to use and integrate in my own project, it worked on the first try. – Prof. Falken Sep 16 '13 at 06:44
1

Look here:
Creating a ZIP file on Windows (XP/2003) in C/C++
http://social.msdn.microsoft.com/Forums/vstudio/en-US/45668d18-2840-4887-87e1-4085201f4103/visual-c-to-unzip-a-zip-file-to-a-specific-directory
But why don't you want to use an external function to unzip a file?

Community
  • 1
  • 1
arc_lupus
  • 3,942
  • 5
  • 45
  • 81