Archived

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

drekkar

detecting enter in edit box

Recommended Posts

drekkar    122
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
drekkar    122
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
drekkar    122
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