From 67024f0f3448e970aaa75fa4de546cfd8aa0fc44 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 25 Jun 2008 11:33:13 -0400 Subject: [PATCH] richedit: Prevented an assertion error on startup when run on Windows. The call to GetClientRect returns 0 values for the returned RECT when called in WM_NCCREATE in on Windows, which ended up causing an assertion error when Wine's riched20.dll replaces the native version. Moving the call to WM_CREATE fixes this problem (probably because NCCALCSIZE is called in between). --- dlls/riched20/editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index b9f41d21784..e71c384536f 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1666,7 +1666,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE; ed->AutoURLDetect_bEnable = FALSE; ed->bHaveFocus = FALSE; - GetClientRect(hWnd, &ed->rcFormat); for (i=0; ipFontCache[i].nRefs = 0; @@ -2934,6 +2933,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y ); } case WM_CREATE: + GetClientRect(hWnd, &editor->rcFormat); if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL) { /* Squelch the default horizontal scrollbar it would make */ ShowScrollBar(editor->hWnd, SB_HORZ, FALSE);