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
2010-08-26 06:52:07
Looks like a .Net code, I am actually using Native Delphi, sorry for not tagging Delphi
rajeem_cariazo
2010-08-26 07:12:25
But you did tag Win32 and WinAPI, thus indicating that you are working with the native Windows API, and not .NET.
Andreas Rejbrand
2010-08-26 07:23:21
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
2010-08-26 07:39:02
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
2010-08-26 07:50:07
@Rob: Documentation are for wussies (:
Nissim
2010-08-26 08:27:21