Article View: borland.public.cppbuilder.multimedia
Article #576PlaySound and threads?
From: A.Gil
Date: Tue, 02 Sep 2003 18:27
Date: Tue, 02 Sep 2003 18:27
21 lines
1814 bytes
1814 bytes
Hi,
I want to use PlaySound for playing a simple wav file when a special
condition occurs in my application.
So, to test it, in the OnClick event of a button:
PlaySound("Ring.wav", NULL, SND_FILENAME | SND_ASYNC);
Well, I realized that when I press the button for the first time, the
number of threads of my application increases in 2, and when the sound
is playing in 3. When the sound finishes this third thread ends.
But the other 2 threads are not terminated(I suppose this has a relation
with allocation of MCI resources).
Since I only want to play the sound one time, how can I terminate these
threads?
(I tried : PlaySound(NULL, NULL, SND_FILENAME | SND_ASYNC); but it
didn't work.)
Thanks.
Andres G.
(Excuse me for my poor English).
Technical Details
Message-ID:
<3f54e125$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,6907e3e2a6aef658,start X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2003-09-02 11:32:06 PST Date: Tue, 02 Sep 2003 20:27:56 +0200 From: "A.Gil" <siloiroc@hotmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.4) Gecko/20030624 X-Accept-Language: es, en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.multimedia Subject: PlaySound and threads? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.60.149.247 Message-ID: <3f54e125$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062527269 213.60.149.247 (2 Sep 2003 11:27:49 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail