Hi everyone. I'm trying to add a RichEdit box to a window. I can create the control fine, and it will display, but if I hold down space within the box the cursor will "overflow" outside of the box and position itsself in the main window. I've tried to narrow it down, and have noticed that the 'overflow' only happens when I create the RichEdit with both the ES_MULTILINE and ES_AUTOHSCROLL options. The cursor will work correctly if I add any text to the box, it's jsut when the box is empty and I "space-bar" over the box. Heres the code im using to create the control:
item_handle[parent] refers the the main window's HWND handle.Code:hwnd=CreateWindowEx(WS_EX_CLIENTEDGE, "RichEdit", "", WS_CHILD|WS_BORDER| WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL| ES_AUTOHSCROLL , x, y, width, height, item_handle[parent], (HMENU)NULL, GetModuleHandle(NULL), NULL); if(hwnd == NULL) MessageBox(NULL, "Could not create editbox.", "Error", MB_OK | MB_ICONERROR); ShowWindow(hwnd,1); UpdateWindow(hwnd);
Any ideas? I've loaded "riched32.dll", and called "InitCommonControls()". Anyone know whats wrong? Thanks.
EDIT: Also, I've tryed keeping it the same, but changeing "RichEdit" to a plaint edit, and it works fine.