Edit Box detecting input
How would I go about detecting when someone presses the enter key in an edit box on my win32 dialog?
I''ve tried hooking the EN_CHANGE notification in the parent window''s WM_COMMAND message bt it still won''t work :\
If you are using a multiline edit make sure you specify the ES_WANTRETURN style. If that doesn''t work, or if you are not using a multiline edit I suggest subclassing the edit and handling the WM_KEYDOWN message.
Qui fut tout, et qui ne fut rien
Invader''s Realm
Qui fut tout, et qui ne fut rien
Invader''s Realm
If I subclass it though, won''t I have to do my own custom drawing or does the win32 api provide a function for doing that?
quote:Original post by Xtremehobo
If I subclass it though, won''t I have to do my own custom drawing or does the win32 api provide a function for doing that?
Nope. You can just handle the WM_KEYDOWN message. Instead of calling DefWindowProc() you can call CallWindowProc() and let the default window proc for the edit handle the drawing. See the example here
Qui fut tout, et qui ne fut rien
Invader''s Realm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement