Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File properties 5

Status
Not open for further replies.

JackTheC

Programmer
Feb 25, 2002
325
NL
When viewing the Explorer in Detailview (in XP) you can add several columns for more information about MP3 or JPG files. e.g. Bitspeed, Albumtitle, Cameramodel, Dimensions (don't know the exact propertynames in English version of XP). It must be possible to extract that information with VFP. Does anyone know how?
 
There is nothing native to VFP that will do this. I don't know how much the Windows API has been extended to support these newer file types and attributes, but finding a Windows API function to do this would be my first effort. I just looked at News2News and didn't see anything. You might try searching MSDN.

pamela
 
I did this recently in PHP.

Here's a rough translation....

loShell = createobject("shell.application");
loDir = loShell.Namespace(lcDir);
lofile = loDir.parsename(lcFile);
lcComment = loDir.GetDetailsOf(lofile,14);

the index in getDetailsof() indicates the property you want... i found the list of properties and indexes somewhere on MSDN but i can't find it right now.

hth

nigel

 
Thanx guys,
I will follow nigelgomms tip and made something like this.
It does really work. Maybe someone else can use it too.

Code:
Dimension arrHeaders(35)
objShell=CreateObject("Shell.Application")
objFolder=objShell.Namespace(sys(5)+sys(2003))

* Array of possible file properties (35)
For i = 0 to 34
 arrHeaders(i+1) = objFolder.GetDetailsOf(objFolder.Items, i)
Next

* create object of an existing file
objFolderItem=objFolder.ParseName('pict_0001.jpg')
* print all 35 properties
For i = 0 to 34
 	? i ,arrHeaders(i+1), ": " , objFolder.GetDetailsOf(objFolderItem, i)
Next

* same with an mp3 file
objFolderItem=objFolder.ParseName('test2.mp3')
For i = 0 to 34
 	? i ,arrHeaders(i+1), ": " , objFolder.GetDetailsOf(objFolderItem, i)
Next
 
JackTheC, very useful piece of code. Have a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top