Enabling Sound Sentry (Windows Embedded CE 6.0)

1/6/2010

The sound sentry option directs the OS to display a visual signal when a sound is generated by a Windows Embedded CEā€“based application.

The user can control the settings for the sound sentry option by using the Sound tab of the Accessibility Control Panel application or another application for customizing the environment.

Applications use the SPI_GETSOUNDSENTRY and SPI_SETSOUNDSENTRY flags with the SystemParametersInfo function to get and set the sound sentry option. The SOUNDSENTRY structure defines the parameters for the sound sentry option. To set the sound sentry option, call SystemParametersInfo with the uiAction parameter set to SPI_SETSOUNDSENTRY, the uiParam parameter set to the size of the SOUNDSENTRY structure, and the pvParam parameter set to a pointer to a SOUNDSENTRY structure that contains the sound sentry parameters that you want to use. You should set the SSF_SOUNDSENTRYON flag in the dwFlags member of the SOUNDSENTRY structure that you pass to SystemParametersInfo.

The following code example shows how to enable the sound sentry option and direct the OS to flash the entire screen when an application generates a sound.

SOUNDSENTRY ssf;
BOOL bSuccess;

// Fill in the members of the SOUNDSENTRY structure.

ssf.cbSize = sizeof(SOUNDSENTRY);
ssf.dwFlags = (SSF_AVAILABLE | SSF_SOUNDSENTRYON);
ssf.iFSTextEffect = 0;
ssf.iFSTextEffectMSec = 0;
ssf.iFSTextEffectColorBits = 0;
ssf.iFSGrafEffect = 0;
ssf.iFSGrafEffectMSec = 0;
ssf.iFSGrafEffectColor = 0;
ssf.iWindowsEffect = SSWF_DISPLAY;
ssf.iWindowsEffectMSec = 0;
ssf.lpszWindowsEffectDLL= NULL;
ssf.iWindowsEffectOrdinal = 0;

// Call SystemParametersInfo with the SPI_SETSOUNDSENTRY flag. 

bSuccess = SystemParametersInfo(SPI_SETSOUNDSSENTRY, sizeof(SOUNDSENTRY), 
                                (LPVOID) &ssf, 0); 

To retrieve information about the sound sentry option, call SystemParametersInfo with uiAction set to SPI_GETSOUNDSENTRY, uiParam set to the size of the SOUNDSENTRY structure, and pvParam set to a pointer to a SOUNDSENTRY structure. Examine the values of the members of the SOUNDSENTRY structure after SystemParametersInfo returns to obtain the information that you want about the sound sentry option.

See Also

Concepts

Enabling Show Sounds

Other Resources

Accessibility Application Development