[PATCH 1/2] riched20: Don't call UpdateWindow after setting the background color.

Alex Henrie alexhenrie24 at gmail.com
Mon May 9 00:01:20 CDT 2016


2016-05-06 0:32 GMT-06:00 Bruno Jesus <00cpxxx at gmail.com>:
> On Fri, May 6, 2016 at 11:04 AM, Alex Henrie <alexhenrie24 at gmail.com> wrote:
>> +static void test_background(void)
>> +{
>> +    HWND hwndRichEdit = new_richedit(NULL);
>> +    RECT updateRect;
>> +
>> +    /* set the background color to black */
>> +    ValidateRect(hwndRichEdit, NULL);
>> +    SendMessageA(hwndRichEdit, EM_SETBKGNDCOLOR, FALSE, 0);
>> +    GetUpdateRect(hwndRichEdit, &updateRect, FALSE);
>> +    ok(!IsRectEmpty(&updateRect), "The update rect should not be empty\n");
>> +
>> +    DestroyWindow(hwndRichEdit);
>> +}
>
> I believe you should clear updateRect before calling GetUpdateRect,
> also according to msdn the return value of GetUpdateRect should also
> reflect if the rect was changed or not so it could be a double test.

The tests in dlls/user32/tests/win.c show that GetUpdateRect always
initializes the rect parameter (unless it is NULL). However, you're
right that checking the return value would be cleaner. I will submit a
simplified version 2 momentarily.

-Alex



More information about the wine-devel mailing list