I subclass an edit control to catch the enter key so I can do something. Once the enter key is pressed, I do something but get a ding... how can I remove that ding?
Posted on 2002-11-11 00:08:09 by Gunner
Who's there? I am! :grin:

Windows only sends out those 'ding' noises because you have setup
a windows sound-scheme. Anyways, the solution should be straight
around the corner.

Since you'r subclassing the edit box, why can't you just add something
like the code below? that code will only let the edit-box process any
other key then the 'return' key.
[color=sienna][SUBCLASS_PROC]

...............
.if uMsg==WM_CHAR
.if wParam!=VK_RETURN
invoke CallWindowProc,OldWndProc,hEdit,uMsg,wParam,lParam
ret
.else
;We have 'found' the 'enter/return' key, lets do something very 'special' :alright:
.endif
.else
invoke CallWindowProc,OldWndProc,hEdit,uMsg,wParam,lParam
ret
.endif
...............
[SUBCLASS_PROC][/color]
Posted on 2002-11-11 02:11:12 by natas
maybe you need also the ES_WANTRETURN style, otherwise the parent dialog does catch the enter key on its own and
translates it into "DEFPUSHBUTTON" pressed.
Posted on 2002-11-11 04:31:19 by beaster
I was using:



.if uMsg==WM_KEYDOWN
.if wParam==VK_RETURN
.
.
.

changed it to:
.if uMsg==WM_CHAR
.if wParam==VK_RETURN
.
.
.

and no ding!!! Thank you!!!
Posted on 2002-11-11 16:17:38 by Gunner