DECLARE SUB PlayMe
DECLARE SUB StopMe
DEFSTR a$
CREATE Form AS QFORM
CAPTION = "Click form to stop current sound"
Width = 320
Height = 240
Center
OnClick = StopMe
CREATE Sounds AS QDXSound
END CREATE
CREATE Button AS QBUTTON
CAPTION = "Click me"
Left = 116
Top = 95
OnClick = PlayMe
END CREATE
END CREATE
SUB PlayMe
RESTORE
DATA tada,ding,chord,chimes,logoff
DO
READ a$
Sounds.Filename = "c:\windows\media\" + a$ + ".wav"
Sounds.Play
WHILE Sounds.Playing
DOEVENTS
WEND
LOOP UNTIL a$ = "logoff"
END SUB
SUB StopMe
Sounds.Stop
a$ = "logoff"
END SUB
Form.SHOWMODAL
|