Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, friends
I created a window by calling win32 CreateWindow function, and put some edit controls on it, (Edit controls also created by CreateWindow function).
It works fine, To navigate between controld, I cachw WM_kEYDOWN and WM_KEYUP, and detect TAB and shift+TAB keys. It also works fine, execpt for a beep sound, which sounds every time TAB is pressed, bothering the user. I need a way to supress this sound for TAB, and some other keystrokes. Note that since this is win32 window and not a dialog, WM_GETDLGCODE is not sent to edit controls. any suggestions appreciated, any related articles also.
Thanks in advance
abzadeh
Posted
Updated 18-Mar-12 7:51am
v2
Comments
Sergey Alexandrovich Kryukov 18-Mar-12 20:39pm    
No sound should be generated unless you do it intentionally, so, it's hard to say where did you screw up. Could you make a short (short!) code sample to reproduce the problem? If so, use "Improve question".
--SA
mr.abzadeh 19-Mar-12 4:14am    
Thanks for your comment.
It's the default behaviour of edit control. The edit control has focus and the window sends key stroke events such as tab, enter, ... to the edit control, and it generates sound since it does not process them. A dialog does not send this key strokes to controls, but process them to navigate between controls. Calling the IsDialogMessage function in the window's message loop processes these key strokes, navigation is done correctly, and sound is not generated,
I realy want to find a way to handle this events myself, in the windows message loop, without using IsDialogMessage. I want to navigate as I wish.
In other words, I want to build my own dialog.
Sergey Alexandrovich Kryukov 19-Mar-12 4:23am    
Thank you for clarification. Still, a simple code sample could probably help.
--SA
Mohibur Rashid 19-Mar-12 4:18am    
case WM_KEYDOWN
switch(LOWORD(wParam))
{
case VK_TAB:
return 0;
}
}

try this and see if works
mr.abzadeh 20-Mar-12 21:16pm    
Thanks for your reply.
I have tested it, and the sound still is played,

1 solution

The beep is emitted when the edit control processes specific keys. To avoid this, you may ignore these keys (WM_CHAR message) in the message processing of the edit control or handle them in the parent windows (dialog) message processing.
 
Share this answer
 
Comments
mr.abzadeh 20-Mar-12 21:25pm    
Thanks, This is the case. It worked
I put this code in the message loop of edit control, and sound was bypassed.

case WM_CHAR: if ( wParam == VK_TAB ) return 0; break;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900