Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

zip/unzip with the win32 api

Posted on 2008-06-24
6
Medium Priority
?
7,681 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
Technology Partners: 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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
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…

705 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