|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I used the below declares in a Module:
Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) And I Used this: Beep 980,1200 In the Form1_Activate and also Form1_Click I haven't heard a scratch! Why? ![]() |
|
#2
|
|||
|
|||
|
One, if your declaration is not all on one line you need to use a line continuation, <space>_
Otherwise I don't know, the code works for me in a command button click. |
|
#3
|
|||
|
|||
|
Woud it make any difference if I was using VB4, can't afford VB6.
|
|
#4
|
|||
|
|||
|
The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes.
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long Private Sub Form_Activate() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net Dim Cnt As Long For Cnt = 0 To 5000 Step 10 'play a tone of 'Cnt' hertz, for 50 milliseconds Beep Cnt, 50 Me.Caption = Cnt DoEvents Next Cnt End Sub |
|
#5
|
|||
|
|||
|
Quote:
I don't think so since it's a Windows API function, unless VB4 has a different mechanism for calling api functions. I guess you'll have to dig through the VB4 documentation ![]() Don't throw stuff at me, but your speaker does work otherwise? I once spent quite a bit of time tracking down a sound problem only to find the speaker wasn't plugged in the motherboard.
__________________
====== Doug G ====== "Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton |
|
#6
|
|||
|
|||
|
Checking it out!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Beep API Command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|