[fpc-pascal]Calling intr from Windows

Rich Pasco pasco at acm.org
Tue Mar 19 07:34:36 CET 2002


Jeff Wormsley wrote:

> Why doesn't Sound work?  Under Win32 the Kernal32 function Beep does it.
> 
> function Beep(dwFreq, dwDuration: DWORD): BOOL; stdcall;
> function Beep; external kernel32 name 'Beep';

I think the problem is that the kernel function Beep needs a second
parameter giving the duration, whereas Sound runs until a subsequent
NoSound comes along.  So it would be hard to implement Sound and
NoSound as calls to Beep.

My work-around in my source code is to use {$ifdef win32} Beep() ...
{$else} Sound() ... NoSound; {$endif}.

     - Rich




More information about the fpc-pascal mailing list