forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


PC Speaker Beep

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 23, 2003 3:28 pm    Post subject: PC Speaker Beep Reply with quote

What API do I use to get a PC Speaker beep? I already tried MessageBeep
and Beep APIs. Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 23, 2003 5:21 pm    Post subject: Reply with quote

I know, I know, I know... Very Happy Please let me look again... Wink
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 23, 2003 5:26 pm    Post subject: Reply with quote

Try this code with the unbeneath parameters... Smile

Code:
%%beepnumber = 0

loadlib user32
%z = @lib(user32,MessageBeep,BOOL:,%%beepnumber)
freelib user32


Quote:
# 0: Default
# 16: Whoom? Smile
# 48: Ping
# 64: Pling?!

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 23, 2003 5:49 pm    Post subject: Reply with quote

Well I was looking for a way to sound it through the internal PC Speaker...
I came up with this code Very Happy :

Code:
LOADLIB kernel32.dll
%A = @lib(kernel32,Beep,INT:,INT:2000,INT:100)
FREELIB kernel32.dll


Thanks to all who helped anyway!

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Jul 27, 2003 12:13 am    Post subject: Reply with quote

Of course this is identical to FreezingFire's good approach, though somewhat more
documented:

Code:

  #define command,pcbeep
  pcbeep 500,400
  pcbeep 1000,500
  pcbeep 1500,600
  pcbeep 2000,700
  pcbeep 2500,800
  exit
:pcbeep
  rem %1 = frequency (Hz; 37 up to 32767; only used on NT based operating systems)
  rem %2 = duration (milliseconds; only used on NT based operating systems)
  rem @ok() is set to false if insuccessful
  loadlib kernel32.dll
  %3 = @lib(kernel32.dll,Beep,bool:,int:%1,int:%2)
  freelib kernel32.dll
  if @zero(%3)
    error -1
  end
  exit

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group