Solved

Working with ZIP files under Win XP

Posted on 2002-06-23
2
563 Views
Last Modified: 2013-12-03
Hi,

when I do the following:

...
SHFILEINFO shfi;
SHGetFileInfo("c:\file.zip", 0, &shfi, sizeof(SHFILEINFO), SHGFI_ATTRIBUTES);
if(shfi.dwAttributes & SFGAO_FOLDER)
{
 //I am getting here

...

In other words Win XP handles zip files as folders. How one can determine under Win XP if folder is a zip file without disabling XP's zip handler? I tried the following:

if(shfi.dwAttributes & SFGAO_FOLDER && !(shfi.dwAttributes & SFGAO_COMPRESSED)
...

but this does not work.

Any help will be greatly appreciated.
0
Comment
Question by:mnbmnb
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 7102206
What about

if ( FILE_ATTRIBUTE_DIRECTORY & GetFileAttributes ( c:\\file.zip") {
//..
}
0
 

Author Comment

by:mnbmnb
ID: 7102290
Good idea. Works fine, thanks.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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