Maybe the program can't find test.wav. Try including the full path-name.

How long is test.wav? Try a short file like the ding.wav that comes with windows (in the media folder.) I read somewhere that when PlaySound() is playing a WAV file, the file is loaded into a RAM buffer first.

I couldn't find the file-size limit just now, but when I once tried to play a "ripped" song with PlaySound(), it was too big.