title: Edit control capture enter key
body: <p>I have an edit control</p>
  
  <pre><code>HWND hInput = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
      WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL, 
      0, 0, 100, 100, hwnd, (HMENU)IDC_MAIN_INPUT, GetModuleHandle(NULL), NULL);
  </code></pre>
  
  <p>and a button:</p>
  
  <pre><code>HWND hSendButton = CreateWindowEx(WS_EX_CLIENTEDGE,"BUTTON","Send!",
          BS_DEFPUSHBUTTON | WS_VISIBLE | WS_CHILD,
          0,0,0,0,hwnd,(HMENU)IDC_MAIN_SENDBUTTON,GetModuleHandle(NULL),NULL);
  </code></pre>
  
  <p>Is there a way to see when the Enter key is pressed while typing in the edit control
  and send a message like the button was pressed?</p>
  
  <p>I think that maybe</p>
  
  <pre><code>SendMessage(hwnd,WM_COMMAND,(WPARAM)IDC_MAIN_SENDBUTTON,LPARAM(0));
  </code></pre>
  
  <p>would do the job for sending the message but I'm still stuck at capturing the Enter key.</p>
  
  <p>Thank you in advance. </p>