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?
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.
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]
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.
translates it into "DEFPUSHBUTTON" pressed.
I was using:
and no ding!!! Thank you!!!
.if uMsg==WM_KEYDOWN
.if wParam==VK_RETURN
.
.
.
changed it to:
.if uMsg==WM_CHAR
.if wParam==VK_RETURN
.
.
.
and no ding!!! Thank you!!!