Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

zip/unzip with the win32 api

Posted on 2008-06-24
6
Medium Priority
?
7,762 Views
Last Modified: 2013-12-03
Hi,

I'm looking for a call to the Win32 API to zip/unzip files.

I do not want to use a 3rd party implementation (no sharpziplib or the like) nor do I want to use the .NET implementations of deflate or GZip, neither of those suit my needs. I searched around on Pinvoke.net for the correct function(s) but was unable to find a suitable one.

Does anyone know if a function for this exists in the Win32 API? I know they do it someplace as in XP & Vista you can view compressed ZIP files as well as the Office 2007 files are really just zipped up containers (this is what I need it for actually). In C++ or C# would be great.

Any suggestions? Thanks!!
0
Comment
Question by:jgarra
6 Comments
 
LVL 7

Expert Comment

by:Christopher Martinez
ID: 21860308
http://msdn.microsoft.com/en-us/magazine/cc164129.aspx
is this what you were looking for?
0
 
LVL 1

Author Comment

by:jgarra
ID: 21860341
Thanks but unfortunately that uses the above referenced SharpZip library which is not something I'm allowed to use for this project.
0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 21860395
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Accepted Solution

by:
maliger earned 2000 total points
ID: 21863825
If you are using c# 3.0 you can use System.IO.Packaging classes (they are specifically made for zipped up containers of Office2007 files).
There are also Office file implemenations on top of this like http://www.codeplex.com/ExcelPackage.

In WinAPI I dont know about any direct ZIP api and I dont think there are such. There are LZ functions (LZCopy e.g.) but thats not exacly what you look for, I think.

The shell32 CopyHere hack presented on anarki link seems pretty hacky (but it can work!). It seems to be undocumented though.
0
 
LVL 24

Expert Comment

by:fridom
ID: 21863895
http://www.nih.at/libzip/

Regards
Friedrich
0
 
LVL 1

Author Closing Comment

by:jgarra
ID: 31470366
Thanks for the tip! They (MS) have such a strange way of organizing some of the dotnet framework!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

824 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