Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FolderItems

17 views
Skip to first unread message

BeeJ

unread,
Apr 1, 2013, 5:55:01 PM4/1/13
to
In this sample code all items defined by sFileSource are set into
FolderItems. I would like to specify precisely the items. i.e. I have
a list of files that I want to put into Folderitems.
I searched MSDN and found little help breaking down these shell32 ops.

What is the format of FolderItems? e.g array of UDT or???

Set ShellClass = New shell32.Shell
Set Filesource = ShellClass.NameSpace(sFileSource)
Set Folderitems = Filesource.Items


Mayayana

unread,
Apr 1, 2013, 6:50:32 PM4/1/13
to
|
| What is the format of FolderItems? e.g array of UDT or???
|

It's a Collection. You don't add to it. It represents
contents of an Explorer folder. Shell was created
specifically to provide Active Desktop folder view for
Explorer. (AD is now gone, but Shell remains.) Shell is
limited and unpredictable. For instance, there are some
file types that won't show up in the FolderItems collection.
As I recall that includes DLL and DRV on Win98, hidden
on XP, etc. The only reason to use Shell is if you actually
need to deal with open folder views, as with an Explorer
Bar that needs to receive an event when the selected
item changes.

--
--

BeeJ

unread,
Apr 1, 2013, 8:25:20 PM4/1/13
to
Mayayana brought next idea :
>>
>> What is the format of FolderItems? e.g array of UDT or???
>>
>
> It's a Collection. You don't add to it. It represents
> contents of an Explorer folder. Shell was created
> specifically to provide Active Desktop folder view for
> Explorer. (AD is now gone, but Shell remains.) Shell is
> limited and unpredictable. For instance, there are some
> file types that won't show up in the FolderItems collection.
> As I recall that includes DLL and DRV on Win98, hidden
> on XP, etc. The only reason to use Shell is if you actually
> need to deal with open folder views, as with an Explorer
> Bar that needs to receive an event when the selected
> item changes.
>
> --

Thanks.

I have made good use of shell32 using the methods as I understand them.

There is a flag to not allow a progress dialog box and that seems to
show up anyway. Using CopyHere.

Will attack the problem another (but more messy) way.

Trying to use Windows (XP and on) Zip (only) capabilities.
In my limited experimenting it does seem to work on individual file and
folders. Is there a better way to invoke Windows Zip capability. Do
not need UnZip.


Mayayana

unread,
Apr 1, 2013, 11:19:18 PM4/1/13
to
| Trying to use Windows (XP and on) Zip (only) capabilities.
| In my limited experimenting it does seem to work on individual file and
| folders. Is there a better way to invoke Windows Zip capability. Do
| not need UnZip.
|

I have seen hacks to do that using VBS, by writing a
skeleton ZIP file to disk and then using Shell to copy
files into it, but I've never tried doing it myself.


BeeJ

unread,
Apr 2, 2013, 7:30:52 PM4/2/13
to
After serious thinking Mayayana wrote :
That does work well for files and folders but I have not been able to
figure out how to filter. Someplace it talked about *.* but I tried
using a filter on files but it refused.

Also I did not see anything to encrypt the contents like I can with
WinZip or 7-Zip. I have those two working beautifully for individual
files or a list of files.

The Win API method is OK in a pinch if WinZip or 7-Zip is not found.

I have not tried to unzip yet with Win API methods.


Mayayana

unread,
Apr 3, 2013, 9:37:21 AM4/3/13
to

| > I have seen hacks to do that using VBS, by writing a
| > skeleton ZIP file to disk and then using Shell to copy
| > files into it, but I've never tried doing it myself.
|
| That does work well for files and folders but I have not been able to
| figure out how to filter. Someplace it talked about *.* but I tried
| using a filter on files but it refused.
|
I'm not sure what you mean. The FolderItems collection
item is a FolderItem object, which has a Name property.
Can't filtering be done in the enumeration of files to add
to the ZIP?

| Also I did not see anything to encrypt the contents like I can with
| WinZip or 7-Zip. I have those two working beautifully for individual
| files or a list of files.
|
| The Win API method is OK in a pinch if WinZip or 7-Zip is not found.
|
I never paid much attention to it for that reason: It
seems to be a half-assed attempt on the part of Microsoft.
As far as I can tell they built in the ability to open ZIPs,
but only did as much as they had to. They didn't even
provide a COM object for it. (Shell itself has always been
a limited and somewhat half-assed object model.)

When I set up systems for people I always give them a
ZIP program, anyway; partly because the Windows functionality
is so limited, and partly because it can be very confusing
for people. They get access to zipped files as if they were
in a folder, but the file is not actually on-disk.

There are also the Info-ZIP DLLs if you don't mind shipping
something. There's VB code around for them, though some
of it is buggy. I used zip32.dll once for creating SFX zips,
with my own SFX stub. It worked fine, but my needs were
only to create a simple ZIP with a few files in it. (I had a
bright idea that I could create a program combining a
simple WYSIWYG webpage editor with the ZIP functionality.
People could make a multi-page greeting, restaurant menu,
sale flier, etc., send it via email as an EXE, and at the other
end opening the file would cause it to unload into TEMP and
open page 1 of the enclosed mini-website in the default
browser. ...That was just before it was decided that security
needed to be tightened in email and that EXE files shouldn't
be accepted as attachments. :)




Schmidt

unread,
Apr 3, 2013, 10:53:30 AM4/3/13
to
Am 03.04.2013 15:37, schrieb Mayayana:
>(I had a bright idea that I could create a program
> combining a simple WYSIWYG webpage editor with the
> ZIP functionality.
> People could make a multi-page greeting, restaurant menu,
> sale flier, etc., send it via email as an EXE, and at the other
> end opening the file would cause it to unload into TEMP and
> open page 1 of the enclosed mini-website in the default
> browser. ...That was just before it was decided that security
> needed to be tightened in email and that EXE files shouldn't
> be accepted as attachments. :)

Just because it fits so well here for yor case...

The RichClient-lib in Version 5 (which is out now BTW -
abailable under:
www.vbRichClient.com/Downloads/vbRC5BaseDlls.zip (about 2.2MB)

It includes (based on it's bultin ZLib and 'gz'
compression-support) also a small Class: cWebArchive

This class can be used as a small Archiver against a
single "RootFolder" (and all its nested content - e.g.
as seen in a typical "WebRoot-Folder").
Compression can be done either into Memory (a ByteArray)
or against a normal (proprietary) Archive-File.
Decompression can be done either against the File-System -
(then writing back the nested Folder-Structure it contains) -
but normally it is used "InMemory" as a kind of "WebCache".

The latter mode can be used in conjunction with e.g.
the built-in cWebServer-Class (with this Class you can
write your own Webserver with only a few lines of
surrounding code).

Those surrounding "few WebServer-Codelines" could then
ensure, that a Browsers WebRequests (which could come
in e.g. over http://127.0.0.1:8888/MyWebarchive.wac
or something) - that you serve an entire "Site" - as if
it was sitting behind a "real WebRoot-Folder" - but it
is then served directly from the equally hierarchical
behaving "WebCache-Archive-Class".

That's done over the Method: cWebArchive.GetContent
which offers a "Key"-Parameter, which interprets the
relative String-Part of an URL - (e.g. "/img/Some.gif"
or "/js/SomeJavaScript.js") directly - and hands out
the cached content then directly as a ByteArray,
ready to be served by the internal WebServer (who only
needs to place proper Mime-Headers in a final step,
before sending the Response back to the Browser.

It can hand out such a concretely specified Resources
also directly in 'gz' compressed format (which all
Browsers understand nowadays) - useful when the small
WebServer runs in the LAN or on the internet, to
minimize the transfer-volume over the wire.

So your idea could be "brought back to life" pretty easily,
when you send such a compressed "WebArchive-attachment"
instead - and offer an accompanying "Server- or Service-
App" over a Download-Link (to be installed only once on
a given system, then registering the FileName-Extension
"*.wac" (or whatever), to start-up automatically with such
a compressed Archive-File instead of a real "WebRoot-Folder".

Just my 2 cents to the topic... :-)

In case you are interested, I could provide a small Demo
for that (a small WebServer, which accepts such archives
as its "virtual WebRoot-Folder" - it's only 10-20 lines of
code or so.

This technique (when used on "localhost" - meaning the IP
"127.0.0.1" - on a free choosable port) is usually not
triggering FireWall-Warnings, because this IP is "hidden"
(not reachable) from outside the machine.
And it could be used also, to e.g. serve Application-
internal "Help-Pages", which could be build and developed
against a normal local WebRoot-Folder - but for shipment
of the App one could include such a compressed "WebArchive",
contained as a ByteArray-Resource directly in the Executable.

Olaf


Mayayana

unread,
Apr 3, 2013, 11:32:56 AM4/3/13
to
Thank you, Olaf. Some interesting ideas. Actually
I have code for .gz using zlibwapi.dll. But my heart is
no longer in shareware. It's like writing a book: A lot
of work that's unlikely to sell. And even if it might sell,
some big corporation will steal the idea and market
it so that one's own version is out of the picture.

My web greeting idea was also tricky in terms of
the target market. People had to be techy enough
to send email attachments and install software on
their own, artistic enough to want to create HTML
pages, but not so artistic that they'd find a WYSIWYG
editor limiting. And your idea of needing to install
something on the target would definitely be out.
It would have to be "one button, no directions".

One of the ways I had provided to send greetings
was also to send them as HTML email, with images
embedded via base64 encoding. I sometimes still use
that method with friends and family to send things like
birthday cards. I don't know of any email program
that ever took advantage of the creative options with
HTML email, so I took the approach of writing a webpage
and then converting that HTML file with its images into
an email. But that approach also has problems: Many
people block HTML email and there's no single, simple
way to find the data necessary to send an email through
someone's email address.

This just doesn't work out:

sInput = Inputbox("Please enter your SMTP server string here.")

It's surprising how broken general compatibility is
between computers and online. We're still operating
with standards from the seat-of-the-pants era. But
even if we weren't, I think the shareware days are over.
I watch people today writing "apps" for smart phones
and see the same pattern that happened with shareware:
A very tiny number get rich. A tiny number make a living.
A small number make a sideline income. The vast majority
make little or nothing. (Even worse, phone apps have to
go through corporate masters, eliminating self-employment.)
And then it's all over. Technology and fashion changes.
The market moves on. Most of the products produced were
mostly just light entertainment, anyway. Programmers are
building e-pacifiers in order to prevent pathologically distracted
modern technology addicts from having tantrums while they
wait for a bus. (The author of Angry Birds is a millionaire,
but if that were me I wouldn't be bragging about it.)


BeeJ

unread,
Apr 3, 2013, 3:36:11 PM4/3/13
to
$ I have seen hacks to do that using VBS, by writing a
I am using the more complex filter @filelist with both WinZip and 7Zip.

Does InfoZip or GZip support encryption and @filelist ?


Mayayana

unread,
Apr 3, 2013, 4:40:16 PM4/3/13
to
| I am using the more complex filter @filelist with both WinZip and 7Zip.
|
| Does InfoZip or GZip support encryption and @filelist ?
|
I think the Info-ZIP DLL supports encryption
and anything else you might want. I don't have
any idea what "@filelist" means.


BeeJ

unread,
Apr 3, 2013, 6:56:00 PM4/3/13
to
It happens that Mayayana formulated :
Instead of a source file name in the command argument list, the
argument is @filelist.
The filelist is a textual file with a list of the filenames to process
into the zip. The syntax is e.g.
@filelist.txt

Therefore a complex filter can be used to generate the filelist which
can include files from any folder and the filter to generate the
filelist can include or exclude whatever.

My app allows a user to drag files and folders from anywhere to be
zipped.

WinZip and 7Zip have the same argument syntax for this feature.


Mayayana

unread,
Apr 4, 2013, 9:28:24 AM4/4/13
to
| Instead of a source file name in the command argument list, the
| argument is @filelist.
| The filelist is a textual file with a list of the filenames to process
| into the zip. The syntax is e.g.
| @filelist.txt
|

I see. I'd never heard of that. With Info-ZIP you'd
be using a DLL, so the whole thing would be internal
to your code rather than a command line. You'd need
to parse your listing file. It would be a lot more work
than 3rd-party command line.


BeeJ

unread,
Apr 4, 2013, 1:03:05 PM4/4/13
to
Mayayana formulated the question :
I dug down into the Info Zip manual and it looks like it supports the
@filelist argument. But I do not see internal encryption.


0 new messages