From: Jactry Zeng Subject: [PATCH 1/2] user32: Implement semi-stub for FlashWindowEx. (resend) Message-Id: <55F8DD08.5010504@codeweavers.com> Date: Wed, 16 Sep 2015 11:07:52 +0800 Superseded patch 114469. --- dlls/user32/tests/win.c | 16 ++++++++-------- dlls/user32/win.c | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 10aa545..be24565 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -7091,13 +7091,13 @@ static void test_FlashWindowEx(void) finfo.hwnd = NULL; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "FlashWindowEx returned with %d\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindowEx returned with %d\n", GetLastError()); finfo.hwnd = hwnd; SetLastError(0xdeadbeef); ret = pFlashWindowEx(NULL); - todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + ok(!ret && GetLastError() == ERROR_NOACCESS, "FlashWindowEx returned with %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -7107,13 +7107,13 @@ static void test_FlashWindowEx(void) finfo.cbSize = sizeof(FLASHWINFO) - 1; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, "FlashWindowEx succeeded\n"); finfo.cbSize = sizeof(FLASHWINFO) + 1; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, "FlashWindowEx succeeded\n"); finfo.cbSize = sizeof(FLASHWINFO); @@ -7121,7 +7121,7 @@ static void test_FlashWindowEx(void) SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "FlashWindowEx returned with %d\n", GetLastError()); ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize); @@ -7137,7 +7137,7 @@ static void test_FlashWindowEx(void) SetLastError(0xdeadbeef); ret = pFlashWindowEx(NULL); - todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + ok(!ret && GetLastError() == ERROR_NOACCESS, "FlashWindowEx returned with %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -7152,7 +7152,7 @@ static void test_FlashWindowEx(void) finfo.dwFlags = FLASHW_STOP; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); -todo_wine + ok(prev != ret, "previous window state should be different\n"); DestroyWindow( hwnd ); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index e3650f5..523d640 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3456,8 +3456,25 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert ) */ BOOL WINAPI FlashWindowEx( PFLASHWINFO pfwi ) { - FIXME("%p\n", pfwi); - return TRUE; + if (!pfwi) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } + + if (!pfwi->hwnd || pfwi->cbSize != sizeof(FLASHWINFO) || !IsWindow( pfwi->hwnd )) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + FIXME( "%p - semi-stub\n", pfwi ); + + /* Do nothing when FLASHW_STOP flag is given. Becuase this semi-stub implementation + call FlashWindow() one time all the time, nothing to be stopped. */ + if (pfwi->dwFlags & FLASHW_STOP) + return TRUE; + + return FlashWindow( pfwi->hwnd, TRUE ); } /*******************************************************************