Jump to content
  • Advertisement

Archived

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

drekkar

detecting enter in edit box

This topic is 5491 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

ok i have an edit box, and when i click it, the edit box receives the focus (which screws up where the messages are going apparently). Now how do i detect when the enter button is hit without GetAsyncKeyState()? The edit box is a child window of the main window so i assumed all the keyboard messages (WM_CHAR, WM_KEYDOWN etc) would go there but they dont, so how do i detect pressing enter while the edit box still has the focus?

Share this post


Link to post
Share on other sites
Advertisement
i did that..

case WM_CHAR:
switch(wParam){
case VK_RETURN:
MessageBox(hwnd, "Enter Detected", "Notice", MB_OK);
break;
}
break;


it works before I click on the edit box, but as soon as the edit box receives focus, it doesn''t send the messages to the parent window

Share this post


Link to post
Share on other sites
I know how to SendMessage() but how do I subclass? I looked around on the net but all I got from it is...

v that is the subclass
class MyEdit : public BaseClass
{
};

do I have to do something like that or..? I''ve never done something like this before ._.;

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!