Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Xtremehobo

Edit Box detecting input

This topic is 5456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :\

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!