Board index » delphi » Beep and son of beep

Beep and son of beep

Why has Beep suddenly started producing 'Not enough parameters' errors?
Where can I find MessageBeep documented?
Why don't Beep and MessageBeep always beep? Is there some way to force
them?
How can I choose which sound to make?
How do I force the use of the default Win sounds for events like
minimise and maximise?
Beep bop a-lula?
 

Re:Beep and son of beep


Quote
Roy Sheridan <rsheri...@orchestration.com> wrote...
> Why has Beep suddenly started producing 'Not enough parameters'
> errors? Where can I find MessageBeep documented? Why don't Beep
> and MessageBeep always beep? Is there some way to force
> them?
> How can I choose which sound to make?
> How do I force the use of the default Win sounds for events
> like minimise and maximise?

MessageBeep is in the WinAPI help. It will show you to use it. Basically,
you pass message box ids to generate different sounds. e.g.

MessageBeep(MB_OK);  // default beep
MessageBeep(MB_ICONEXCLAMATION); // exclamation beep

If you have a sound card installed, these beeps will use it. Some
motherboards have built in sound, but in many (mainly corporate)
environments the sound output is not connected so the above beeps are
silent.

Use $FFFFFFFF to force a 'pc speaker' beep. The sound you get from this
version of MessageBeep is quite variable and dependent on you PC's speed
etc.

The Beep function is declared in both SysUtils.pas and Windows.pas. The
SysUtils version takes no parameters and just calls MessageBeep(0). The
Windows version takes two parameters:

BOOL Beep(
    DWORD dwFreq, // sound frequency, in hertz
    DWORD dwDuration  // sound duration, in milliseconds
   );

However, it only works properly on NT, not Windows 95 (not sure about 98).
The Win32 help will give more details.

--
Tim Knipe | Plasmatech Software Design | http://plasmatech.com
Windows Explorer controls for Delphi, C++Builder and ActiveX!

Re:Beep and son of beep


Following up on this, you can force Delphi to compile with one or the other
Beep's by prefacing the call with the unit it comes from, like SysUtils.Beep
or Windows.Beep(...).
-Howard Moon
Quote
Tim Knipe wrote in message <7i0dgg$f...@forums.borland.com>...
>The Beep function is declared in both SysUtils.pas and Windows.pas. The
>SysUtils version takes no parameters and just calls MessageBeep(0). The
>Windows version takes two parameters:

Other Threads