A beep sound

Please discuss general Delphi programming topics here.

A beep sound

Postby MrNotToSmartGuy » June 29th, 2007, 9:42 pm

Is there a way to program a Beep?
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby Codius » June 29th, 2007, 9:46 pm

Yep!

Beep; - Found in SysUtils
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby MrNotToSmartGuy » June 29th, 2007, 11:38 pm

yeah ... how to do access that sysutls
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby MrNotToSmartGuy » June 30th, 2007, 12:24 am

i type beep; nothing happens
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby Kambiz » June 30th, 2007, 12:34 am

Try MessageBeep API of Windows.

Code: Select all
function MessageBeep(uType: Cardinal): Boolean;


where uType is:
  • $FFFFFFFF
    Standard beep using the computer speaker
  • MB_ICONASTERISK
    System Asterisk
  • MB_ICONEXCLAMATION
    System Exclamation
  • MB_ICONHAND
    System Hand
  • MB_ICONQUESTION
    System Question
  • MB_OK
    System Default
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby MrNotToSmartGuy » June 30th, 2007, 1:49 am

thank you for the reply. when I type the function MessageBeep delphi doesn't understand what MessageBeep is, do I have to include something in the uses part?
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby Kambiz » June 30th, 2007, 1:08 pm

Yes! windows should be in uses clause.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby MrNotToSmartGuy » July 1st, 2007, 2:14 am

continue := MessageBeep($FFFFFFFF );

This is what I have an I'm not getting it to beep. Continue is a boolean
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby MrNotToSmartGuy » July 1st, 2007, 4:38 am

it is a consol applicatoin if that matters
MrNotToSmartGuy
Active Member
Active Member
 
Posts: 8
Joined: June 28th, 2007, 4:29 pm

Postby Kambiz » July 1st, 2007, 3:31 pm

MrNotToSmartGuy wrote:it is a consol applicatoin if that matters

Of course, it does matter.
Try this one, it should work:

Code: Select all
procedure Beep;
begin
  Write(#8);
end;
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 16 guests

cron