Article View: free.it.visual-basic
Article #2000Re: Attendere la fine di un evento - PlaySound
From: Giovanni Chieli
Date: Sun, 26 Oct 2003 23:41
Date: Sun, 26 Oct 2003 23:41
45 lines
2497 bytes
2497 bytes
> Ho utilizzato la funzione PlaySound:
>
> (Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA"
> (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long)
As
> Long)
>
> tutto ok, solo che vorrei che il mio programma continuasse con
l'istruzione
> successiva solo dopo che il file .wav e' stato eseguito completamente.
>
La soluzione � far eseguire la musica in modo sincrono impostando le flag
attese tramite il parametro dwFlags :
Private Const SND_ASYNC = &H1
Private Const SND_FILENAME = &H20000
Private Const SND_LOOP = &H8
Private Const SND_MEMORY = &H4
Private Const SND_NODEFAULT = &H2
Private Const SND_NOSTOP = &H10
Private Const SND_NOWAIT = &H2000
Private Const SND_PURGE = &H40
Private Const SND_RESOURCE = &H40004
Private Const SND_SYNC = &H0
Public Enum EnumPlayModeConstant
AsyncExecute = SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY
WaitForSong = SND_SYNC Or SND_NODEFAULT Or SND_MEMORY
AsyncLoop = SND_ASYNC Or SND_LOOP Or SND_NODEFAULT Or SND_MEMORY
End Enum
significano:
esecuzione asincrona: continua ad eseguire il codice immediatamente dopo
aver avviatol'esecuzione
Esecuzione asincrona: Termina l' esecuzione prima di passare all'
istruzione successiva
Loop Asincrono: esegue il brano all' infinito ma continua l' esecuzione
del codice
Ciao
Technical Details
Message-ID:
<QYYmb.51579$e5.1882306@news1.tin.it>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!NewsITBone-GARR!bofh.it!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mailReferences:
<g9Xmb.69754$e6.2508736@twister2.libero.it>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f94ee,181ef0313b5e1bfc X-Google-Attributes: gidf94ee,public X-Google-Thread: 10b997,181ef0313b5e1bfc X-Google-Attributes: gid10b997,public X-Google-ArrivalTime: 2003-10-26 15:41:36 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!NewsITBone-GARR!bofh.it!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail From: "Giovanni Chieli" <giocheli_nspm_@tin.it> Newsgroups: free.it.visual-basic,it.comp.lang.visual-basic References: <g9Xmb.69754$e6.2508736@twister2.libero.it> Subject: Re: Attendere la fine di un evento - PlaySound Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <QYYmb.51579$e5.1882306@news1.tin.it> Date: Sun, 26 Oct 2003 23:41:36 GMT NNTP-Posting-Host: 80.104.169.21 X-Complaints-To: newsmaster@tin.it X-Trace: news1.tin.it 1067211696 80.104.169.21 (Mon, 27 Oct 2003 00:41:36 MET) NNTP-Posting-Date: Mon, 27 Oct 2003 00:41:36 MET Organization: TIN