Okay I got a richedit working (finally), after many hours of messing around with the code. Simple fix, long path to get there. But anyways, I get no errors whatsoever now so the RichEdit should be created, right? Well wrong, I try to click in the area where this RichEdit should be and the mouse doesn't change as it should when moving over a richedit or editbox. I even resized it and gave it a border (which should have been seen because of the resizing... made it smaller then the window it was being created in) and still no sign of the thing. Any ideas? Check code below:
The above code is the WM_CREATE message of the window the RichEdit is being created in. (This is an MDI interface, btw.) The DLL is already properly loaded (riched20.dll) which doesn't return any errors upon started and so it should be loaded properly. I do end up receiving the "RichEdit Control for Status Window created." message everytime the program starts and so I don't know how it shouldn't be there. If you can help me out with this one I would be greatly appreciative!Code:case WM_CREATE: GetClientRect(hwnd, &rect); swnd.CmdLine = CreateWindow("EDIT", "", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL, rect.left - 1, rect.bottom - 17, rect.right + 2 - rect.left, 18, hwnd, NULL, NULL, NULL); if( swnd.CmdLine == NULL ) { err = GetLastError(); sprintf(buffer, "Couldn't create CMDLINE for status window. (%d)", err); MessageBox(NULL, buffer, "Creation Error", MB_ICONERROR); } else { swnd.Display = CreateWindowEx(WS_EX_CLIENTEDGE, chCntrlName, "RichEdit Test", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, rect.left + 15, rect.top + 15, rect.left - rect.right - 30, rect.bottom - rect.top - 30, hwnd, (HMENU)IDC_MYRICHEDIT, NULL, NULL); // swnd.Display = CreateWindowEx(WS_EX_CLIENTEDGE, chCntrlName, "", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, rect.left - 1, rect.top - 1, rect.left - rect.right + 2, rect.bottom - 17 - rect.top , hwnd, (HMENU)IDC_MYRICHEDIT, NULL, NULL); if( swnd.Display == NULL ) { err = GetLastError(); sprintf(buffer, "Couldn't create DISPLAY for status window. (%d)", err); MessageBox(NULL, buffer, "Creation Error", MB_ICONERROR); } else { ShowWindow(swnd.Display, SW_SHOW); StatusReady = TRUE; MessageBox(NULL, TEXT("RichEdit Control for Status Window created."), TEXT("Creation Success!"), MB_OK); AppendText(swnd.hWnd, COLOR_DK_GREEN, "Testing!"); // SetWindowText(swnd.Display, "Testing!"); // SetWindowText(swnd.Display, "Testing a second time."); } } break;



LinkBack URL
About LinkBacks


