Solved

Working with ZIP files under Win XP

Posted on 2002-06-23
2
566 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

829 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