   Disabling notification ('clonk') sounds in a program
  This is the problem: I went to extremes to maximize functionality by setting up a keyboard hook so I can handle appropriate input from all of the relevant windows (which just happen to be dialog boxes, so it even makes sense...). Anyway, now I have this little popup dialog that allows the user to enter a value and then, when he presses return, the value is updated or when he presses escape, the dialog is closed. Both events are captured from within an edit control (that is, I'm not handling the edit control's messages, but I'm handling all relevant input using a hook). The problem is that when the user presses either of these keys, Windows plays a jolly little 'clonk' sound (or whatever sound may be bound on any particular system) like when you get an error report in the form of a MessageBox(). Needless to say, that's annoying (kind of feels like whipping yourself for candy...) since the user may tinker with the value many times before he settles. And each time he presses the enter key, Windows greets him with a little sound. Is there any way I can disable this - definitely for the entire system, but possibly for the edit box or at least the application?   
  Why are you using a hook... for something that can and should be done using messages? And I believe if you catch those messages and doesn't call the next hook it will not play that sound. (just catch them and just do nothing if you want to use your hook)   ;Quote:Original post by SyranideWhy are you using a hook... for something that can and should be done using messages? And I believe if you catch those messages and doesn't call the next hook it will not play that sound. (just catch them and just do nothing if you want to use your hook)Thank you! Never though of that (returning 1 doesn't play the sound).Why use a hook? Because it reduces input code size and complexity by roughly 90% when using multiple dialog boxes (which is the case here). The problem arises when you try to implement a global key response (such as ESC exits the program, regardless of which window in the current module has focus) - the input handling code would become a nightmare. Besides, handling keyboard input from the children of a dialog box is nasty enough and in this particular case I could add the functionality I needed by simply adding a three-stage test in the hook procedure...Why are hooks that bad in such a situation - I'm not abusing them in any way?   