So I have that RichEdit box created with the CreateWindow method. I want to bind the enter key on it, so when someone press Enter, I want to execute a method called ProcessCommand. I tried to put the WM_KEYDOWN event on my main wnd proc, but it just works as long as the focus is not on the edit control (I can change to a standard edit box if it makes it easier)
HWND hTypeZone;
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LoadLibrary("RICHED20.DLL");
switch (uMsg)
{
case WM_CREATE:
hTypeZone = CreateWindow("RichEdit20A", "", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_WANTRETURN | WS_VSCROLL | ES_AUTOHSCROLL, 5, 410, 610, 24, hwnd, NULL, hinst, NULL);
HWND hTypeZone;
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LoadLibrary("RICHED20.DLL");
switch (uMsg)
{
case WM_CREATE:
hTypeZone = CreateWindow("RichEdit20A", "", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_WANTRETURN | WS_VSCROLL | ES_AUTOHSCROLL, 5, 410, 610, 24, hwnd, NULL, hinst, NULL);