Hm well with a bit of messing around I came up with this code to handle the WM_ERASEBKGND message:
Code:
RECT rc;
HDC hdc = GetDC(hwnd);
GetWindowRect(hRiched[currentEdit],&rc);
ExcludeClipRect(hdc,rc.left,rc.top-1-GetSystemMetrics(SM_CYMENUSIZE)-GetSystemMetrics(SM_CYCAPTION),rc.right,rc.bottom-GetSystemMetrics(SM_CYMENUSIZE)-GetSystemMetrics(SM_CYCAPTION));
GetClientRect(hwnd,&rc);
HBRUSH hbr = CreateSolidBrush(RGB(88,87,104));
FillRect(hdc,&rc,hbr);
DeleteBrush(hbr);
ReleaseDC(hwnd,hdc);
return 0;
Although I'm not sure how to be sure the rect that I get for the rich edit window lines up properly...
Which kind of ties in to a weird problem. When I create my main window I create it with the following styles:
Code:
WS_POPUP|WS_CAPTION|WS_MAXIMIZE|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN
And it looks the way I want when I run it from VS, but when I don't run it from VS, it isn't maximized (still takes up the whole screen,but has a border). So you can move it around, which I don't want.