In there any way to play Windows native sounds using Inno Setup?
For example I'm showing a custom message box, and I need to play Windows warning/info/error sound before showing that message. Any way?
Use PlaySound
WinAPI function:
const
SND_ASYNC = $0001;
SND_ALIAS = $00010000;
function PlaySound(pszSound: string; hmod: THandle; fdwSound: DWORD): BOOL;
external 'PlaySoundW@Winmm.dll stdcall';
Use it like:
PlaySound('SystemQuestion', 0, SND_ALIAS or SND_ASYNC);
For list of standard sound aliases, see:
https://learn.microsoft.com/en-us/windows/win32/multimedia/using-playsound-to-play-system-sounds