🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.nativeapi.win32
3 messages
3 total messages Started by Bo Berglund Sun, 06 Jul 2008 10:50
How to modify the file properties from Delphi?
#104
Author: Bo Berglund
Date: Sun, 06 Jul 2008 10:50
22 lines
1772 bytes
If I rightclick a file in Windows Explorer and select "Properties"
then a window pops up with a tabbed dialogue. One of the tabs is
titled "Summary" and in this there are some items that one can
actually fill in, such as "Comments".

Now we have a customer request that when we use a particular file for
processing in an automation environment we should write to the comment
the timestamp of usage and some identifying string as well.
He will then use Windows Explorer with the Comment field enabled in
the right-hand pane (Detail view) to see which files have been used
and when.

It is not possible to modify the file contents itself because then it
gets unusable in the main application. Mostly the files in question
are program files for machine tools.

I guess that the "Comment" is some kind of NTFS metadata and now I
would like to know if it is possible to programmatically edit this
info using Delphi 7??


/BoB
Re: How to modify the file properties from Delphi?
#163
Author: Remy Lebeau (TeamB)
Date: Mon, 07 Jul 2008 18:07
26 lines
1829 bytes
"Bo Berglund" <bo.berglund@telia.com> wrote in message 
news:je81741v2ksng8qv54099j6sjncoo6m6oe@4ax.com...

> I guess that the "Comment" is some kind of NTFS metadata

Yes, it is.  Specifically, it is part of the "Summary Information Property 
Set" stream:

    http://msdn.microsoft.com/en-us/library/aa380376(VS.85).aspx

> I would like to know if it is possible to programmatically edit this
> info using Delphi 7??

Yes, but there are several steps involved to reach it.  Read the following 
chaptre of MSDN for more details:

    Structured Storage
    http://msdn.microsoft.com/en-us/library/aa380369(VS.85).aspx

In a nutshell, you will need to use the StdCreateStorage/Ex() and/or 
StdOpenStorage/Ex() function to retreive an IPropertySetStorage interface, 
and then you can use that to update the Summary information as needed.


Gambit 
Re: How to modify the file properties from Delphi?
#168
Author: Jens Gruschel
Date: Tue, 08 Jul 2008 14:27
10 lines
1381 bytes
> In a nutshell, you will need to use the StdCreateStorage/Ex() and/or 
> StdOpenStorage/Ex() function to retreive an IPropertySetStorage interface, 
> and then you can use that to update the Summary information as needed.

I guess that should have been StgCreateStorage/Ex() and/or 
StgOpenStorage/Ex(). Anyway, quite interesting...

-- 
Jens Gruschel
http://www.pegtop.net
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads