tags:

views:

78

answers:

2

I am making my own installer and it's almost complete. The only thing lacking is the sound when installation is complete. Is that a windows API call or I will need to find that audio file and play that from the source code?

A: 

You can easily play the default system sounds by using:

System.Media.SystemSounds.Beep.Play();
System.Media.SystemSounds.Asterisk.Play();
System.Media.SystemSounds.Exclamation.Play();
System.Media.SystemSounds.Hand.Play();
System.Media.SystemSounds.Question.Play();
Nissim
Looks like a .Net code, I am actually using Native Delphi, sorry for not tagging Delphi
rajeem_cariazo
But you did tag Win32 and WinAPI, thus indicating that you are working with the native Windows API, and not .NET.
Andreas Rejbrand
So, as Andreas answered, use the MessageBeep (user32.dll). If you want the different sound types use: Asterisk = 0x40, Beep = 0, Exclamation = 0X30, Hand = 0x10, Question = 0x20.
Nissim
No, @Nissim, do as the documentation says and use Asterisk = `MB_ICONASTERISK`, Beep = `MB_OK`, Exclamation = `MB_ICONWARNING`, Hand = `MB_ICONHAND`, and Question = `MB_ICONQUESTION`.
Rob Kennedy
@Rob: Documentation are for wussies (:
Nissim
+4  A: 

Use the MessageBeep function.

Andreas Rejbrand
Thanks, I've used MessageBeep(MB_ICONINFORMATION);
rajeem_cariazo