The WinAPI C code below makes a sound. How to make it work quietly?

MessageBox ( NULL, "text", "text", MB_OK | MB_SETFOREGROUND | MB_TOPMOST | MB_SYSTEMMODAL | MB_ICONINFORMATION ); 
  • in this case - no way - Sublihim
  • You can run and turn off the message sound (or unscrew the volume) before displaying the message, and then go back again. - KoVadim
  • 2
    Remove MB_ICONINFORMATION . - VladD
  • @VladD thanks, it helped. - 0Zerro
  • @ 0Zerro: Designed as an answer. - VladD

1 answer 1

This is a built-in feature of the system MessageBox 'a: if an information icon is displayed, a sound is played. To reconfigure this, apparently, it is impossible, but you can simply remove the MB_ICONINFORMATION flag.

An alternative solution is to rewrite the MessageBox itself from scratch - too complicated. But, of course, will work too.