|
-
Jan 29th, 2000, 03:55 AM
#2
PowerPoster
Hey Bernie
You mean a command button...? 
Use API. Try this:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub StopSound_Click()
Dim i As Long, RS As String, cb As Long
RS = Space$(128)
i = mciSendString("stop sound", RS, 128, cb)
i = mciSendString("close sound", RS, 128, cb)
End Sub
Private Sub StartSound_Click()
StopSound_Click
Dim i As Long, RS As String, cb As Long, W$
RS = Space$(128)
W$ = "c:\windows\media\done.wav"
i = mciSendString("open waveaudio!" & W$ & " alias sound", RS, 128, cb)
If i Then MsgBox "Error! Probably file not found. Modify the code to point to a .WAV file on your system."
i = mciSendString("play sound", RS, 128, cb)
End Sub
Good luck
Regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|