Re: 'birdtwitter.wav'

new topic     » goto parent     » topic index » view thread      » older message » newer message

George -

Sorry to be so slow with this information, but maybe it will be of some help
anyway. As
Bernie's msg(s) indicated you probably don't want to "go this way" for several
reasons.
To my mind, the most important is that there's really no such thing in Windows
as a fixed
set of "system sounds;" the user is free to set and use whatever sounds he
chooses, and
the actual .wav sound files can be located anywhere on the system. IOW, the
"sound
system" for system events is modular. The definition of an "appropriate" sound -
including none at all - is up to the user, and is set  using the Control Panel.
The
"sounds" distributed with Windows as defaults are really just "free samples",
and there's
no guarantee that they exist at all on any given system, much less have any
guaranteed
location.  Many users, such as myself, not only turn off the sound output, but
disassociate the sound files from the "system events" and even delete the .wav
files, or
move them "out of the way." This leaves you basically unable to predict what
sound, if
any,  is even available, much less appropriate. I'm sure M$ will eventually
rectify a
situation in which the user is so blatantly given control over his own hardware;
in the
meantime you're spinning your wheels.

All that having been said, he's some specific information about how to access
existing
sound settings programmatically -

The sound files associated with "system events" are "registered," oddly enough,
in the
Windows Registry, under HKCU - AppEvents - Schemes - Apps. As you can observe,
there are
a number of different sounds registered (or not), both by Windows, and by
individual
programs, e.g. Netscape and AOL,  for their own use. There is actually nothing
specifically identified as "program error" or even "system error." Depending on
your
needs, you would probably choose from AppGPFault, SystemAsterisk,
SystemExclamation,
SystemHand, or System Question. In each case there is probably a setting for
"current"
and "default," but these can both be blank if the user removed the assocations
thru the
Control Panel Sound app.

A further "real world" complexity is this - it's possible, and not *really
rare,* for the
wav files to be deleted or moved *without* disassociating the sounds and without
receiving any error msg until the event linked to the file is triggered, at
which point
the original error which triggered, for example, "SystemExclamation," is
superseded by
the error of "SystemExclamation" not finding the missing wav file .. (No
guarantee any
other program ever raised SystemExclamation since the linked file was deleted.).

In short - it's not worth messing with. If you want predictable sounds, supply
your own
and invoke them within your program, otherwise go with whatever's set.

Ben


George Henry wrote:

> Bernie,
>
> I don't want to change the system sounds. Rather, I want to use the current
> system sound that is most appropriate to the situation. How do I find out
> what wav file Windows is currently using for "program error", so I can play
> that sound, instead of some arbitrarily chosen sound?
>
> It's the same sound that message_box() -- drilling a little deeper,
> MessageBoxA() in user32.dll -- plays (whether I want it to or not, which
> generally I don't 8^( ). On my computer and instance of Windows 98, since
> I'm using the Falling Leaves desktop theme, that sound happens to be a bird
> twitter. But I don't want to try to play "birdtwitter.wav" (not the actual
> name, I'm not bothering to look it up just now) on EVERYONE's computer, when
> my program experiences an error, esp. considering that they may not even
> HAVE the Falling Leaves theme on their machine! See my problem?
>
> George
>
> >From: Bernie <xotron at PCOM.NET>
>
> >... your program should
>       use it's own wave files and not be concerned about what sounds
>       are associated with what instance. Remember that a user maybe
>       running a word processor or some other program at the same time
>       as your application is running. Changing the system sounds changes
>       the sounds for all runing programs and may mess up the other
>       programs that are running. There are files in the archive for
>       playing wave files.
>
>
> _____________________________________________________________________________________
> Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu