home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
envelop
/
envelop.3
/
Program
/
winmm.eto
< prev
Wrap
Text File
|
1996-07-08
|
1KB
|
43 lines
Type WinMM
Declare Function sndPlaySoundA Lib "Winmm" (ByVal file as string, ByVal opt as long) as long
' call with name of wav file or name of registered windows sound
Declare Function mciSendStringA Lib "Winmm" (ByVal cmnd as string, ByVal rtn as string, ByVal rtnsize as long, ByVal hwin as long) as long
Declare Function mciGetErrorStringA Lib "Winmm" (ByVal err as long, ByVal etxt as string, ByVal etxtsize as long) as long
Const SND_SYNC = 0 'return after sound played
Const SND_ASYNC = 1 'return right away, sound plays async
Const SND_NODEFAULT = 2 'return silently if not found
Const SND_MEMORY = 4 'file is an in memory image
Const SND_LOOP = 8 'combine with async, play loop till next call
Const SND_NOSTOP = 16 'return without playing if player busy
Dim result As Long
Dim resultstr As String
Sub ParseError(err as long)
If err == 0 Then
resultstr = "OK"
Else
resultstr = Space(251)
mciGetErrorStringA(err, resultstr, 250)
End If
End Sub
' example usages
' result = mciSendStringA("open c:\chicago\media\wndsurf1.avi alias surf", "", 0, 0)
' ParseError(result)
' result = mciSendStringA("play surf", "", 0, 0)
' result = mciSendStringA("stop surf", "", 0, 0)
' result = mciSendStringA("close surf", "", 0, 0)
' sndPlaySoundA("ding.wav",0)
End Type
Begin Code
WinMM.result = 256
WinMM.resultstr = space(251)
End Code