From: Thomas Bluemel Date: Sun, 1 Jan 2006 13:45:09 +0000 (+0000) Subject: Fixed calculating the size of empty message boxes. Fixes bug 1224 X-Git-Tag: backups/expat-rbuild@40467~639 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=e0d9018bb4d8cb02f9c159804f9858a856527bcc Fixed calculating the size of empty message boxes. Fixes bug 1224 svn path=/trunk/; revision=20511 --- diff --git a/reactos/lib/user32/windows/messagebox.c b/reactos/lib/user32/windows/messagebox.c index 559781114c3..3f5eda62431 100644 --- a/reactos/lib/user32/windows/messagebox.c +++ b/reactos/lib/user32/windows/messagebox.c @@ -493,7 +493,15 @@ MessageBoxTimeoutIndirectW( txtrect.right -= GetSystemMetrics(SM_CXICON) + MSGBOXEX_SPACING; txtrect.top = txtrect.left = txtrect.bottom = 0; SelectObject(hDC, hFont); - DrawTextW(hDC, text, textlen, &txtrect, DT_LEFT | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT); + if (textlen != 0) + { + DrawTextW(hDC, text, textlen, &txtrect, DT_LEFT | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT); + } + else + { + txtrect.right = txtrect.left + 1; + txtrect.bottom = txtrect.top + 1; + } txtrect.right++; /* calculate position and size of the icon */