user32/static: Allow setting NULL text.

This commit is contained in:
Nikolay Sivov 2015-03-23 08:12:29 +03:00 committed by Alexandre Julliard
parent 6e638d824b
commit c5dda71cd4
2 changed files with 22 additions and 9 deletions

View File

@ -464,15 +464,12 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
case WM_SETTEXT:
if (hasTextStyle( full_style ))
{
if (HIWORD(lParam))
{
if(unicode)
lResult = DefWindowProcW( hwnd, uMsg, wParam, lParam );
else
lResult = DefWindowProcA( hwnd, uMsg, wParam, lParam );
STATIC_TryPaintFcn( hwnd, full_style );
}
}
if (unicode)
lResult = DefWindowProcW( hwnd, uMsg, wParam, lParam );
else
lResult = DefWindowProcA( hwnd, uMsg, wParam, lParam );
STATIC_TryPaintFcn( hwnd, full_style );
}
break;
case WM_SETFONT:

View File

@ -117,6 +117,21 @@ static void test_updates(int style, int flags)
DestroyWindow(hStatic);
}
static void test_set_text(void)
{
HWND hStatic = build_static(SS_SIMPLE);
char buffA[10];
GetWindowTextA(hStatic, buffA, sizeof(buffA));
ok(!strcmp(buffA, "Test"), "got wrong text %s\n", buffA);
SetWindowTextA(hStatic, NULL);
GetWindowTextA(hStatic, buffA, sizeof(buffA));
ok(buffA[0] == 0, "got wrong text %s\n", buffA);
DestroyWindow(hStatic);
}
START_TEST(static)
{
static const char szClassName[] = "testclass";
@ -148,6 +163,7 @@ START_TEST(static)
test_updates(SS_WHITERECT, TODO_COUNT);
test_updates(SS_ETCHEDHORZ, TODO_COUNT);
test_updates(SS_ETCHEDVERT, TODO_COUNT);
test_set_text();
DestroyWindow(hMainWnd);
}