Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can I change the default beep sound?

Posted on 1997-12-26
9
Medium Priority
?
259 Views
Last Modified: 2008-03-04
I am using VB4/32 and want to change the default beep sound.
I tried using the API reference, but all the beeps still sound the same.

Thanks,
Don
0
Comment
Question by:deross
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 4

Expert Comment

by:rantanen
ID: 1447495
You use MessageBeep API as follows (VB5/Win95):

Put following declarations in a forms general section

Private Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
Const MB_OK = &H0&
Const MB_ICONASTERISK = &H40&
Const MB_ICONEXCLAMATION = &H30&
Const MB_ICONHAND = &H10&
Const MB_ICONQUESTION = &H20&
Const INTERNAL_SPEAKER = -1

and add implied controls and following code

Private Sub Command1_Click()
    Dim lResult As Long
   
    Select Case List1.List(List1.ListIndex)
        Case "MB_OK"
            lResult = MessageBeep(MB_OK)
        Case "MB_ICONASTERISK"
            lResult = MessageBeep(MB_ICONASTERISK)
        Case "MB_ICONEXCLAMATION"
            lResult = MessageBeep(MB_ICONEXCLAMATION)
        Case "MB_ICONHAND"
            lResult = MessageBeep(MB_ICONHAND)
        Case "MB_ICONQUESTION"
            lResult = MessageBeep(MB_ICONQUESTION)
        Case "INTERNAL_SPEAKER"
            lResult = MessageBeep(INTERNAL_SPEAKER)
    End Select
End Sub

Private Sub Form_Load()
    List1.AddItem "MB_OK"
    List1.AddItem "MB_ICONASTERISK"
    List1.AddItem "MB_ICONEXCLAMATION"
    List1.AddItem "MB_ICONHAND"
    List1.AddItem "MB_ICONQUESTION"
    List1.AddItem "INTERNAL_SPEAKER"
End Sub

0
 
LVL 4

Expert Comment

by:rantanen
ID: 1447496
Or did you mean how to change the .wav file assigned as system default sound? If that's the case then I'm sorry I misunderstood your question. I thought you meant how to use MessageBeep API call.
0
 

Author Comment

by:deross
ID: 1447497
Hi rantanen,

I have tried the above suggestion but I still get the same sounding beep for whatever I chose from the list.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Expert Comment

by:rantanen
ID: 1447498
Do you have a soundcard installed?
0
 

Author Comment

by:deross
ID: 1447499
Yes, I have a SoundBlaster Pro.

0
 
LVL 4

Expert Comment

by:rantanen
ID: 1447500
Then in Control Panel -> Sounds, do you have different WAV files assigned to different events? If not, do some changes there.
0
 

Author Comment

by:deross
ID: 1447501
I'm sorry if I mislead you, but I am creating this program for someone who does not have a sound card installed and I want to generate different sounding beeps through their internal speaker.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1447502
This isn't possible under Win95 directly. Microsoft has removed the sound APIs from Win32, and if you want to call them, you must build a separate program in 16bit VB, and use it as a DDE server from your program
0
 
LVL 4

Accepted Solution

by:
rantanen earned 100 total points
ID: 1447503
Sorry that I forgot to get back to you :-(

There is a way to do it. Check out following MS KB article:

How to Install and Use the PC Speaker Driver with Windows 95

Last reviewed: May 1, 1997
Article ID: Q138857 95 WINDOWS kbmm

Following are two excrepts from this article:

"SUMMARY

Speak.exe contains a Microsoft Windows sound driver that allows most .wav files to be played on the PC speaker on most computers not equipped with a sound card. This article describes how to obtain, install, and use the PC speaker driver with Microsoft Windows 95. "

" Internet (anonymous FTP)

      ftp ftp.microsoft.com
      Change to the Softlib/Mslfiles folder.
      Get SPEAK.EXE (size: 22312 bytes) "

Of course the drawback (as far as I know) is that you can play only WAV files, but anyway - you can get "similar " sounds connected to different events as in a computer with sound card.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question