如何在VB工程中打开多个文件

来源:百度知道 编辑:UC知道 时间:2024/07/03 02:51:05
刚学VB 写了一个播放器 但还不会向播放列表假如多个文件 一次只能打开一个文件 请问该如何打开多个文件 谢谢 谢谢
我想 向播放列表添加多个视频文件,一个个循环播放 谢谢

加入控件:windonsmediaplayer1,command1(caption=打开文件),command2(caption=停止),,filebox,timer(Timer1.Interval = 500)按照以上设置好
代码
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias _
"SHGetPathFromIDListA" (ByVal pIdl As Long, ByVal pszPath As String) As Long

Private Type BrowseInfo
hwndOwner As Long
piDLroot As Long
pszdisplayName As String
lpsztitle As String
ulFlags As Long
lpfncallback As Long
lParam As Long
iImage As Long
End Type
Private Sub command1_Click()
Dim bi As BrowseInfo
Dim folderid As Long
Dim pb As String
With bi
.hwndOwner = Me.hWnd
.lpsztitle = "把输出的文件存放到这个文件夹:"
.ulFlags = 3
End With
folderid = SHBrowseForFolder(bi)
If folderid = 0 Then Exit Sub
pb = String$(260, 0)
SHGetPathFromIDList folderid, p