VB4.0与Windows 95 API接口的多媒体应用程序设计的实例

Visual Basic以其简单、快捷的特点深受广大多媒体开发者的喜爱,VB4.0与Windows 95 API接口的多媒体应用程序设计实例。用Visual Basicfor Windows 95(以下简称VB4.0)可以迅速地编写出真正的Windows 95应用软件,尤其是在VB4.0中通过调用Windows 95 API函数,一方面可以灵活地利用Windows 95提供的系统资源,另一方面无需调用VB的MCI(多媒体控制接口),使多媒体软件编写更方便。

VB4.0与Windows 95 API接口的多媒体应用程序设计的实例

本文所提供的'源程序,具有简单、方便操作和易于移植使用的特点。

该程序可以使用户选择播放*文件,如稍加改动即可播放其他格式的多媒体文件。本程序经VB4.0编译通过。

调用*文件源程序如下:

源程序清单:

’窗体的特性表

VERSION 4.00

Begin files01

Caption="Files"

ClientHeight=4365

ClientLeft=1095

ClientTop=1515

ClientWidth=7230

Height=4770

Left=1035

LinkTopic="files"

ScaleHeight=4365

ScaleWidth=7230

Top=1170

Width=7350

Begin andButton Command1

Caption="Ok"

Height=735

Left=5880

TabIndex=4

Top=1800

Width=615

End

Begin Box text1

Height=375

Left=600

TabIndex=3

Top=360

Width=5415

End

Begin ListBox File1

Height=2760

Left=2760

TabIndex=2

Top=1080

Width=2175

End

Begin istBox Dir1

Height=2280

Left=600

TabIndex=1

Top=1560

Width=1815

End

Begin eListBox Drive1

Height=315

Left=720

TabIndex=0

Top=1080

Width=1695

End

End

’窗体代码

Attribute VB-Name="files01"

Attribute VB-Creatable=False

Attribute VB-Exposed=False

Private Sub Command1-Click

Load file02

End Sub

Private Sub Dir1-Change

=

End Sub

Private Sub Drive1-Change

=e

End Sub

Private Sub File1-Click

=

End Sub

Private Sub File1-DblClick

pth$=

If Right$(pth$,1)=""Then

=pth$ Name

Else

=pth$ "" Name

End If

End Sub

’窗体特性表

VERSION 4.00

Begin file02

Caption="file02"

ClientHeight=4230

ClientLeft=1095

ClientTop=1515