When trying to rerender a window with a textbox the corner of the textbox is not rendered correctly.
It's just white, there is no corner. Directly after creating the textbox, everything is OK. After rerendering using InvalidateRect(NULL, NULL, true);
, the box is away and there is only the text in it until I move the mouse over it.
The edit is created using CreateWindowEx with the parameters WS_EX_CLIENTEDGE
and WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL
Update: Just found out that the problem is away when rendering outside of a rectangle.
Example: When loading the WinAPI example project which ships with Mono-D (winsamp.d) and adding the following code to WM_PAINT: RoundRect(dc, 0, 0, 300, 300, 1, 1);
and the following code to a button click handler (the one with IDC_BTNCLICK)
try
{
HMENU h = CreateWindowExW(WS_EX_CLIENTEDGE, "edit".toUTF16z, "".toUTF16z, WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | WS_CLIPCHILDREN, 100, 100, 100, 100, hWnd, cast(HMENU)100, GetModuleHandleA(null), null);
HFONT font = CreateFontW(15, 0, 0, 0, FW_NORMAL, 0, 0, 0, CP_UTF8, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, ("Tahoma").toUTF16z);
SendMessageA(h, WM_SETFONT, cast(int)font, 0);
InvalidateRect(null, null, true);
}
catch(Throwable e) {}
the problem occurs.