Thread: Nasty 'Bing' Sound

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    36

    Nasty 'Bing' Sound

    Hi

    I subclassed an Edit control to get notified if the user presses return in it. This so far works fine, but everytime I type something in the edit and press return, it plays the window standard signal wave (when unchanged the nasty 'bing') before processing the input.

    My question is, does someone know why it plays that sound and how I can avoid it?

    cheers,

    PrivatePanic
    "I don't know with what weapons World War III will be fought... but World War IV will be fought with sticks and stones." - Albert Einstein

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    That is the notorious sound that the edit is NOT getting the key press. Search these board with the keywords "GetWindowLong" and "SetWindowLong" for a good explanation on the matter...
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    36
    Erm yeah I know there's plenty topics about subclassing... I read em, but I still don't know why my subclassed edit plays that sound.

    - The editproc function checks if <return> is pressed and if so, does some stuff and returns CallWindowProc.

    - Or, if it was another key that was pressed, just return CallWindowProc without doing the stuff.

    So there shouldn't be any difference except the stuff is run or not; and the stuff doesn't produce that sound. So I have no idea why that sound is played.

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You can eliminate the problem a lot of the time by having your "Ok" (or whatever) button as your default push button.

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    36
    Well it's no Dialog, it's a normal Window.

    The subclassing iself works fine, as I said... and if it will 'bing' everytime, fine, it's not a problem either, but if someone knows a possibility to get rid of it, I'll use it
    "I don't know with what weapons World War III will be fought... but World War IV will be fought with sticks and stones." - Albert Einstein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sound lags in multi-thread version
    By VirtualAce in forum Game Programming
    Replies: 23
    Last Post: 08-27-2008, 11:54 AM
  2. Low latency sound effects
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 12-21-2004, 01:58 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. DirectSound - multiple sounds
    By Magos in forum Game Programming
    Replies: 9
    Last Post: 03-03-2004, 04:33 PM
  5. sounds?
    By BODYBUILDNERD in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2002, 03:34 PM