Archived

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

detecting enter in edit box

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