Article ID: 122158
Article Last Modified on 11/18/2003
Build State sndPlaySound() MessageBeep()
Sound Name Beep Type
-----------------------------------------------------------
Build is up to date BuildUpToDate MB_ICONASTERISK
Build has errors BuildError MB_ICONEXCLAMATION
Build has warnings BuildWarning MB_ICONQUESTION
Build complete BuildComplete MB_ICONASTERISK
Build cancelled <nothing> <nothing>
In addition, Visual C++ version 4.0 supports the following sound states:
State sndPlaySound() MessageBeep()
Sound Name Beep Type
-----------------------------------------------------------
Breakpoint Hit MSVC_HitBP <nothing>
Error in Output MSVC_OutputError <nothing>
Warning in Output MSVC_OutputWarning <nothing>
If a sound card is not installed, you can modify the system sounds by
choosing the Sound icon from the Control Panel. If you have a sound card
installed, you need to modify the registry to add the sndPlaySound()
sound names to enable sound before you change the sounds in the Control
Panel.
HKEY_CURRENT_USER\Control Panel\SoundsYou can use the following sample C program to automatically add these sounds, or you can use REGEDT32.EXE to directly modify the registry. After the modifications, your registry should contain the following lines for Visual C++ 2.x:
BuildComplete:REG_SZ:tada.wav,Build Complete BuildUpToDate:REG_SZ:ding.wav,Build Up To Date BuildError:REG_SZ:ding.wav,Build Error BuildWarning:REG_SZ:ding.wav,Build WarningAfter the modifications, your registry should contain the following lines for Visual C++ 4.0:
BuildComplete : REG_SZ : tada.wav,MSDev: Build Complete BuildUpToDate : REG_SZ : ding.wav,MSDev: Build Up To Date BuildError : REG_SZ : ding.wav,MSDev: Build Error BuildWarning : REG_SZ : ding.wav,MSDev: Build Warning
/* Compile options needed: Default build options for a console
application.
*/
#include <windows.h>
#include <stdio.h>
#include <string.h>
char *sound[4] = { "BuildComplete", "BuildUpToDate",
"BuildError", "BuildWarning" };
#if _MSC_VER == 1000 // using Visual C++ 4.0
char *soundValue[4] = { "tada.wav,MSDev: Build Complete",
"ding.wav,MSDev: Build Up To Date",
"ding.wav,MSDev: Build Error",
"ding.wav,MSDev: Build Warning" };
#else // using Visual C++ 2.x
char *soundValue[4] = { "tada.wav,Build Complete",
"ding.wav,Build Up To Date",
"ding.wav,Build Error",
"ding.wav,Build Warning" };
#endif
void main( void )
{
int i;
HKEY hCPanel;
HKEY hSounds;
if ((ERROR_SUCCESS != RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel",
0, KEY_SET_VALUE, &hCPanel)) ||
(ERROR_SUCCESS != RegOpenKeyEx(hCPanel, "Sounds",
0, KEY_SET_VALUE, &hSounds)))
{
printf("Error opening HKEY_CURRENT_USER\\Control Panel\\Sounds\n");
exit(-1);
}
for (i=0; i<4; i++)
if (ERROR_SUCCESS != RegSetValueEx(hSounds, sound[i], 0, REG_SZ,
(unsigned char*) soundValue[i], strlen(soundValue[i]) + 1))
printf("Could not set sound: %s\n", sound[i]);
RegCloseKey(hSounds);
RegCloseKey(hCPanel);
printf("Sounds were successfully added\n");
exit(0);
}
Additional query words: kbsound 2.00 2.10 4.00 beep sound blaster vwb visual workbench ide
Keywords: kbinfo kbcode KB122158