Solved

zip/unzip with the win32 api

Posted on 2008-06-24
6
7,434 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 3

Accepted Solution

by:
maliger earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

733 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