WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DllCall Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Beep


;========================================================
; Kernel32 Beep UDF
; Syntax: BeepK32(Frequency,Duration)
; Frequency = Value in Hz
; Duration = Value in miliseconds?
;=========================================================
#DefineFunction BeepK32(frequency,duration)
kernel32=strcat(dirwindows(1),"kernel32.dll")
dllcall(kernel32,long:"Beep",long:frequency,long:duration)
#EndFunction

;Examples
for rndbeeploop = 1 to 100
frequency = random(5000)
duration = random(80)
BeepK32(frequency,duration)
next rndbeeploop
TimeDelay(1)

BeepK32(1000,70)
BeepK32(400,70)
BeepK32(1000,70)
BeepK32(400,70)
BeepK32(1340,200)
TimeDelay(1)

for beepfreq = 100 to 2000 by 50
BeepK32(beepfreq,1)
next beepfreq
BeepK32(2000,80)

for beepfreq = 1000 to 1800 by 50
BeepK32(beepfreq,5)
next beepfreq
BeepK32(1800,50)

for beepfreq = 1800 to 400 by -50
BeepK32(beepfreq,8)
next beepfreq

exit

Article ID:   W15926
File Created: 2004:03:30:15:41:44
Last Updated: 2004:03:30:15:41:44