Commit c5dda71c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32/static: Allow setting NULL text.

parent 6e638d82
......@@ -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:
......
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment