dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: the bell from ****

  1. #1
    Join Date
    Aug 2001
    Posts
    1,447

    the bell from ****

    I just moved a bunch of VB development to a different machine and now all my msg boxes ring a bell, which they did not do on the first machine.

    the machine differences are "good" machine has WinXP and no external sound system (no sound card or speakers, just normal PC speaker)

    "bad" machine runs Win98 and has a SoundBlaser Live sound card w/ external speaker.

    Why sound card should matter, I can't imagine, since I thought the bell was a "normal PC speaker" thing, but I mention it in case there's some difference I'm not aware of.

    any clues? this bell is driving me nuts, but I really don't want to rip out all my msgbox use

  2. #2
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090
    Go to Control panel and choose Sounds. After the Sounds dialog appears, select from the listbox under Events the Default sound. Now from the combobox below Name choose (none).
    If you want to disable sounds associated with different windows events then from the combobox below Schemes select (none).

  3. #3
    Join Date
    Aug 2001
    Posts
    1,447
    good call --- works like a charm, of course. Thanks. I feel like a doofus for not thinking of that myself.

    Now I've killed the "default" sound for EVERYTHING, whereas I really only wanted to kill it for my VB apps.

    Is there any API call that kills the sound for just the current app?

  4. #4
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090
    Try setting the sound volume to zero in your application. I think the API calls below should help.
    Code:
    Private Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long
    Private Declare Function auxGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByRef lpdwVolume As VolumeSetting) As Long

  5. #5
    Join Date
    Aug 2001
    Posts
    1,447
    MKSa, thanks. I'll give this a try

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    a trick...

    Create a new wav file of samll size with no sound at all (=register silence for the smallest time you can). Associate that wav with events...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)