🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14189

PlaySound and Threads?

#14189
From: A.Gil
Date: Wed, 03 Sep 2003 20:29
21 lines
1751 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: <3f564f31@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-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,8079f7bba4b267d7,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-03 13:40:22 PST
Date: Wed, 03 Sep 2003 22:29:35 +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.nativeapi
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: <3f564f31@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062620977 213.60.149.247 (3 Sep 2003 13:29:37 -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-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail