Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This function plays a file synchronously.

Syntax

HRESULT SndPlaySync (
  LPCTSTR 
pszSoundFile,
  DWORD 
dwFlags
);

Parameters

pszSoundFile

[in] Sound filename.

dwFlags

Indicates playback options.

Note:
Currently, the only flag supported is SND_PLAY_IGNOREUSERSETTINGS, so dwFlags can be either 0 or SND_PLAY_IGNOREUSERSETTINGS.

Return Value

The function returns S_OK if the sound played successfully, otherwise it will return a standard HRESULT error code. If any flag besides SND_PLAY_IGNOREUSERSETTINGS are set through parameter dwFlags, the function will return E_INVALIDARG.

Requirements

Header soundfile.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile 6 Classic and later, Windows Mobile 6 Professional and later, Windows Mobile 6 Standard and later

See Also

Concepts

Sounds Reference