Commit 455eca6d authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched20: Return nonzero value instead of zero when EM_SETREADONLY succeeds.

parent b4ce0760
...@@ -3479,7 +3479,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3479,7 +3479,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->styleFlags |= ES_READONLY; editor->styleFlags |= ES_READONLY;
else else
editor->styleFlags &= ~ES_READONLY; editor->styleFlags &= ~ES_READONLY;
return 0; return 1;
} }
case EM_SETEVENTMASK: case EM_SETEVENTMASK:
{ {
......
...@@ -7576,6 +7576,25 @@ static void test_reset_default_para_fmt( void ) ...@@ -7576,6 +7576,25 @@ static void test_reset_default_para_fmt( void )
DestroyWindow( richedit ); DestroyWindow( richedit );
} }
static void test_EM_SETREADONLY(void)
{
HWND richedit = new_richeditW(NULL);
DWORD dwStyle;
LRESULT res;
res = SendMessageA(richedit, EM_SETREADONLY, TRUE, 0);
ok(res == 1, "EM_SETREADONLY\n");
dwStyle = GetWindowLongA(richedit, GWL_STYLE);
ok(dwStyle & ES_READONLY, "got wrong value: 0x%x\n", dwStyle & ES_READONLY);
res = SendMessageA(richedit, EM_SETREADONLY, FALSE, 0);
ok(res == 1, "EM_SETREADONLY\n");
dwStyle = GetWindowLongA(richedit, GWL_STYLE);
ok(!(dwStyle & ES_READONLY), "got wrong value: 0x%x\n", dwStyle & ES_READONLY);
DestroyWindow(richedit);
}
START_TEST( editor ) START_TEST( editor )
{ {
BOOL ret; BOOL ret;
...@@ -7639,6 +7658,7 @@ START_TEST( editor ) ...@@ -7639,6 +7658,7 @@ START_TEST( editor )
test_enter(); test_enter();
test_WM_CREATE(); test_WM_CREATE();
test_reset_default_para_fmt(); test_reset_default_para_fmt();
test_EM_SETREADONLY();
/* Set the environment variable WINETEST_RICHED20 to keep windows /* Set the environment variable WINETEST_RICHED20 to keep windows
* responsive and open for 30 seconds. This is useful for debugging. * responsive and open for 30 seconds. This is useful for debugging.
......
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