Information générale
Catégorie:
Fonctions Windows API
Here is a little code I got pointed to from here, hope this helps.
#DEFINE SND_SYNC 0x00
#DEFINE SND_ASYNC 0x01
#DEFINE SND_NODEFAULT 0x02
#DEFINE SND_LOOP 0x08
#DEFINE SND_STOP 0x0f
#DEFINE SND_NOSTOP 0x10
PARAMETERS lptype,csndfile
IF EMPTY(lptype)
lptype = "NOSTOP"
*!* lptype = "ASYNCLOOP"
*!* lptype = "STOP"
ELSE
lptype = ALLTRIM(UPPER(lptype))
ENDIF
IF EMPTY(csndfile)
csndfile = "C:\WINDOWS\MEDIA\The Microsoft Sound.wav"
*!* csndfile = "C:\WINDOWS\MEDIA\DING.WAV"
ENDIF
DECLARE INTEGER sndPlaySound IN winmm.DLL STRING cSoundName, INTEGER uFlags
DO CASE
CASE lptype == "SYNC"
sndPlaySound( csndfile, SND_SYNC )
CASE lptype == "ASYNC"
sndPlaySound( csndfile, SND_ASYNC )
CASE lptype == "NOSTOP"
sndPlaySound( csndfile, SND_NOSTOP )
CASE lptype == "STOP"
sndPlaySound( csndfile, SND_STOP )
CASE lptype == "ASYNCLOOP"
sndPlaySound( csndfile, SND_ASYNC + SND_LOOP)
ENDCASE
RETURN
? sndPlaySound( x, 16 ) && delay till finished
? "I don't execute until the sound is done"
x = "C:\WINDOWS\MEDIA\DING.WAV"
*!* * this program plays a sound for 10 seconds
*!* #define SND_SYNC 0x00
*!* #define SND_ASYNC 0x01
*!* #define SND_NODEFAULT 0x02
*!* #define SND_LOOP 0x08
*!* #define SND_NOSTOP 0x10
*!* declare integer sndPlaySound in winmm.dll string cSoundName, integer uFlags
*!* =sndPlaySound( "c:\windows\media\ctmelody.wav", SND_ASYNC + SND_LOOP )
*!* =INKEY(10)
*!* * you could put some usefull processing in here instead!
*!* =sndPlaySound( .NULL. , SND_NODEFAULT)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement