Mega Code Archive

 
Categories / Delphi / Examples
 

Calling windows beep[] function

Question: I want to call the Windows Beep() function, but I get the error "Too many parameters" when compiling. How can I get around this? Answer: The Beep() procedure is declared both in the SysUtils unit and the Windows unit. The following example demonstrates calling both procedures. procedure TForm1.Button1Click(Sender: TObject); begin SysUtils.Beep; Windows.Beep(100, 1000); end;