我使用shell32.dll来检索文件的扩展属性。我的文本框将显示文件的每个属性(iCollumn -1到300),但它不会显示framewidth或frameheight(以及许多其他属性)。
有没有办法使用shell32.dll获取这些?如果没有,是否有另一种方法来获取这些缺失的属性?
注意:我在Windows资源管理器中显示了扩展,我的项目引用了Microsoft shell控件和自动化。
代码:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim objShell As Shell32.Shell
Dim objFolder As Shell32.Folder
objShell = New Shell32.Shell
objFolder = objShell.NameSpace("C:\Users\Sam\Videos")
If (Not objFolder Is Nothing) Then
Dim objFolderItem As Shell32.FolderItem
objFolderItem = objFolder.ParseName("Kick_Ass.avi")
If (Not objFolderItem Is Nothing) Then
Dim szItem As String
szItem = objFolder.GetDetailsOf(objFolderItem, 168)
End If
For i = -1 To 300
TextBox1.Text += i & “: ” & objFolder.GetDetailsOf(objFolderItem, i) & vbCrLf
Next
objFolderItem = Nothing
End If
objFolder = Nothing
objShell = Nothing
End Sub
输出(为了空间我只显示了没有显示的结果):
-1: Item type: VLC media file (.avi)
Size: 1.36 GB
Length: 01:52:53
Availability: Available offline
0: Kick_Ass.avi
1: 1.36 GB
2: VLC media file (.avi)
3: 10/05/2010 12:49 AM
4: 11/02/2016 1:59 PM
5: 11/02/2016 1:59 PM
6: A
8: Available offline
9: Video
10: Sam-PC\Sam
11: Video
19: Unrated
27: 01:52:53
28: 384kbps
29: No
50: 930 GB
54: SAM-PC (this PC)
157: .avi
158: Kick_Ass.avi
162: 813 GB
180: No
183: Videos
184: C:\Users\Sam\Videos
185: Videos (C:\Users\Sam)
187: C:\Users\Sam\Videos\Kick_Ass.avi
189: VLC media file (.avi)
246: 12%
286: Sam-PC\HomeUsers
287: Shared
288: Available
答案 0 :(得分:0)
视频帧宽度位于索引i = 316
(例如,它将包含1920这样的值)。
视频帧高度位于索引i = 314
(例如,它将包含1080之类的值)。
可能的objFolderItem
详细信息的索引似乎高达i = 320
。