 |
PlaySound ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Plays a sound specified by the given file name, resource, or system event. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL PlaySound(
LPCTSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER PlaySound IN winmm;
STRING pszSound,;
INTEGER hmod,;
LONG fdwSound
|
 |
 |
 |
| Parameters: |
 |
pszSound
A string that specifies the sound to play. The maximum length, including the null terminator, is 256 characters.
hmod
Handle to the executable file that contains the resource to be loaded. This parameter must be NULL unless SND_RESOURCE is specified in fdwSound.
fdwSound
Flags for playing the sound.
|
 |
 |
| Return value: |
 |
| Returns TRUE if successful or FALSE otherwise. |
 |
 |
| Usage: |
 |
#DEFINE SND_FILENAME 0x20000
#DEFINE SND_ASYNC 1
= PlaySound("c:\windows\media\tada.wav", 0,;
BITOR(SND_FILENAME, SND_ASYNC))
|
 |
 |
| My comment: |
 |
For playing system sounds rather than sounds stored in WAV files, it is better to declare this function as follows:
DECLARE INTEGER PlaySound IN winmm;
LONG pszSound, INTEGER hmod, LONG fdwSound
Below is FoxPro equivalent to sndAlias("S", "W") macro (SND_ALIAS_SYSTEMWELCOME) :
nSoundId = BITOR(buf2dword(PADR("S",4,CHR(0))),;
BITLSHIFT(buf2dword(PADR("W",4,CHR(0))),8)) && returns 22355
This will play the SND_ALIAS_SYSTEMWELCOME sound:
= PlaySound(22355, 0, BITOR(SND_ALIAS_ID, SND_ASYNC))
See also: sndPlaySound |
 |
 |
| Word Index links for the PlaySound : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2008-03-25 15:28:58 | | Modified: | 2009-01-15 15:50:35 | Visited in last 7 days: 45 |