Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access Windows Sound Events? 1

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
I would like to play a sound in my App. Currently I'm using the PlaySound API call and it works great.
However, I would like to further enhance this by playing a certian type of sound according to the current sound scheme windows is using. This would let my application adapt to the user's preferences.

My question is: How doo I call, for example, the Critical Stop sound event, which in turn would access the associated wav file (whatever the user has specified that to be). Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
I found the answer to my own question (it was like looking for a needle in a haystack):

When calling the PlaySound API function, substitute the path of the wave file with the name of the sound event as defined in the sound schemes.

Here's and example:

PlaySound "Exclamation", 0, SND_ASYNC
Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
Michael -

Wow, that's an easy solution!

Can you post that as a FAQ?

Thanks.
Chip H.
 
FAQ already posted :) Good luck guys :) Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top