The GetDetailsOf() Method
-
Hello friends, I'm writing a program that reads all the files in a specified folder and stores their attributes in a MS-Access database. I'm using the FileInfo, and the FileVersionInfo classes to query file attributes. But these classes don't expose properties or methods to query advanced attributes such as image dimensions, ablum title, etc. I googled to find out the answer and it came up with GetDetailsOf method of shell32.dll. It seems that the GetDetailsOf method would be a perfect fit for my purpose as I only need to read that info. But what is really worrying me is its portability. The second argument is an integer and it specifies the info. to be retrieved. Is its value consistent across all Windows versions. I just want to make sure that I don't get two different values for the same file, with the same integer value under different Windows versions. Many thanks in advance
-
Hello friends, I'm writing a program that reads all the files in a specified folder and stores their attributes in a MS-Access database. I'm using the FileInfo, and the FileVersionInfo classes to query file attributes. But these classes don't expose properties or methods to query advanced attributes such as image dimensions, ablum title, etc. I googled to find out the answer and it came up with GetDetailsOf method of shell32.dll. It seems that the GetDetailsOf method would be a perfect fit for my purpose as I only need to read that info. But what is really worrying me is its portability. The second argument is an integer and it specifies the info. to be retrieved. Is its value consistent across all Windows versions. I just want to make sure that I don't get two different values for the same file, with the same integer value under different Windows versions. Many thanks in advance
Yes, those constants are the same from version to version. They won't change the constants, only add to them.
Ankit Rajpoot wrote:
But what is really worrying me is its portability.
What's your definition of "portability" and your concerns? Which platforms are you going to look at supporting? Or were you just referring to the constants passed to the GetDetailsOf method?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Yes, those constants are the same from version to version. They won't change the constants, only add to them.
Ankit Rajpoot wrote:
But what is really worrying me is its portability.
What's your definition of "portability" and your concerns? Which platforms are you going to look at supporting? Or were you just referring to the constants passed to the GetDetailsOf method?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hello Sir, I'm planning to support Win98 and later versions of Windows. I've Windows XP SP2 on my Development machine. So I need to make sure that the code that I write and test on Xp runs on earlier versions too and on Vista too. What I'm worried about is that the constant-value to file-attribute mapping is same on all Windows versions or not. For example, passing 15 returns the Artist's name from the file. Is it true for all Windows versions.
-
Hello Sir, I'm planning to support Win98 and later versions of Windows. I've Windows XP SP2 on my Development machine. So I need to make sure that the code that I write and test on Xp runs on earlier versions too and on Vista too. What I'm worried about is that the constant-value to file-attribute mapping is same on all Windows versions or not. For example, passing 15 returns the Artist's name from the file. Is it true for all Windows versions.
Ankit Rajpoot wrote:
What I'm worried about is that the constant-value to file-attribute mapping is same on all Windows versions or not. For example, passing 15 returns the Artist's name from the file. Is it true for all Windows versions.
Yes, it is. If there are any changes, they are additions to the constant list. All previous constants will work the same way they did in previous versions of Win32.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008