Archive: Using System Plugin to play Windows default sound.


Using System Plugin to play Windows default sound.
Most likely it's possible to use the System Plugin to play a default Windows sound e.g. ding.wav / notify.wav etc.

I just have not idea how to do it :(

Anyone willing to offer a working example?



!addplugindir "."
!addincludedir "."

!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"

!include "MUI2.nsh"

OutFile "test.exe"

Function .onInit
!define MB_ICONASTERISK 0x00000040
!define SystemDefault 0x0000000
Sleep 500
System::Call "user32::MessageBeep(i ${MB_ICONASTERISK})"
Sleep 500
System::Call "user32::MessageBeep(i ${SystemDefault})"

!define SND_ALIAS 0x10000
!define SND_FILENAME 0x20000
sleep 500
System::Call "winmm::PlaySound(t 'SystemStart', i 0, i ${SND_ALIAS})"
sleep 500
System::Call "winmm::PlaySound(t 'c:\WINDOWS\Media\notify.wav', i 0, i ${SND_FILENAME})"
FunctionEnd

Section
SectionEnd

!insertmacro MUI_LANGUAGE "English"


See:
http://msdn.microsoft.com/en-us/library/ms680356(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms712879.aspx

Respect!!!

Thank you for the fast and accurate response!