I want to send a compiled macro that gives audio feedback depending on success or failure, when run. However, I want to avoid the need to send specific .wav files & specify locations, etc. I also don't feel I can depend on any specific .wav file to be found in the windows folder - for that matter, I can't be sure the windows folder is named 'Windows'.
Under Windows control panel, sounds & audio devices, are default sound configurations for windows. I'm thinking I should be able to acquire the current paths to the 'Default Beep' and 'Exclamation' sounds in Windows, to always ensure I have valid sound files, without concern with locating them.
Is this the best plan, and if so, what's an easy way to do this?
Using default system sounds, instead of specified .wav files
Moderators: Dorian (MJT support), JRL
Use the Windows API PlaySound function. Like this:
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMSTART,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMEXIT,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMHAND,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMASTERISK,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMQUESTION,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMEXCLAMATION,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMWELCOME,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMDEFAULT,0,0
LibFunc>winmm.dll,PlaySoundA,ps,Mailbeep,0,0
LibFunc>winmm.dll,PlaySoundA,ps,WindowsLogon,0,0
Just provide the sound alias name. Earlier versions of windows listed these in win.ini. In XP you'll find them in the registry under:
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMSTART,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMEXIT,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMHAND,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMASTERISK,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMQUESTION,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMEXCLAMATION,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMWELCOME,0,0
LibFunc>winmm.dll,PlaySoundA,ps,SYSTEMDEFAULT,0,0
LibFunc>winmm.dll,PlaySoundA,ps,Mailbeep,0,0
LibFunc>winmm.dll,PlaySoundA,ps,WindowsLogon,0,0
Just provide the sound alias name. Earlier versions of windows listed these in win.ini. In XP you'll find them in the registry under:
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\
MJT Net Support
[email protected]
[email protected]