Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Using System Plugin to play Windows default sound. (http://forums.winamp.com/showthread.php?t=305159)

Red Wine 9th April 2009 14:53

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?

Animaether 9th April 2009 15:52

code:

!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

Red Wine 9th April 2009 16:11

Respect!!!

Thank you for the fast and accurate response!


All times are GMT. The time now is 17:49.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.