Commit f22760d2 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

user32: Implement semi-stub for FlashWindowEx.

parent d2d11419
...@@ -7085,14 +7085,14 @@ static void test_FlashWindow(void) ...@@ -7085,14 +7085,14 @@ static void test_FlashWindow(void)
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = pFlashWindow( NULL, TRUE ); ret = pFlashWindow( NULL, TRUE );
todo_wine ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindow returned with %d\n", GetLastError() ); "FlashWindow returned with %d\n", GetLastError() );
DestroyWindow( hwnd ); DestroyWindow( hwnd );
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
ret = pFlashWindow( hwnd, TRUE ); ret = pFlashWindow( hwnd, TRUE );
todo_wine ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindow returned with %d\n", GetLastError() ); "FlashWindow returned with %d\n", GetLastError() );
} }
...@@ -7119,13 +7119,13 @@ static void test_FlashWindowEx(void) ...@@ -7119,13 +7119,13 @@ static void test_FlashWindowEx(void)
finfo.hwnd = NULL; finfo.hwnd = NULL;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo); ret = pFlashWindowEx(&finfo);
todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindowEx returned with %d\n", GetLastError()); "FlashWindowEx returned with %d\n", GetLastError());
finfo.hwnd = hwnd; finfo.hwnd = hwnd;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(NULL); ret = pFlashWindowEx(NULL);
todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, ok(!ret && GetLastError() == ERROR_NOACCESS,
"FlashWindowEx returned with %d\n", GetLastError()); "FlashWindowEx returned with %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -7135,13 +7135,13 @@ static void test_FlashWindowEx(void) ...@@ -7135,13 +7135,13 @@ static void test_FlashWindowEx(void)
finfo.cbSize = sizeof(FLASHWINFO) - 1; finfo.cbSize = sizeof(FLASHWINFO) - 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo); ret = pFlashWindowEx(&finfo);
todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindowEx succeeded\n"); "FlashWindowEx succeeded\n");
finfo.cbSize = sizeof(FLASHWINFO) + 1; finfo.cbSize = sizeof(FLASHWINFO) + 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo); ret = pFlashWindowEx(&finfo);
todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindowEx succeeded\n"); "FlashWindowEx succeeded\n");
finfo.cbSize = sizeof(FLASHWINFO); finfo.cbSize = sizeof(FLASHWINFO);
...@@ -7149,7 +7149,7 @@ static void test_FlashWindowEx(void) ...@@ -7149,7 +7149,7 @@ static void test_FlashWindowEx(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo); ret = pFlashWindowEx(&finfo);
todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"FlashWindowEx returned with %d\n", GetLastError()); "FlashWindowEx returned with %d\n", GetLastError());
ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize); ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize);
...@@ -7165,7 +7165,7 @@ static void test_FlashWindowEx(void) ...@@ -7165,7 +7165,7 @@ static void test_FlashWindowEx(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(NULL); ret = pFlashWindowEx(NULL);
todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, ok(!ret && GetLastError() == ERROR_NOACCESS,
"FlashWindowEx returned with %d\n", GetLastError()); "FlashWindowEx returned with %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -7180,7 +7180,6 @@ static void test_FlashWindowEx(void) ...@@ -7180,7 +7180,6 @@ static void test_FlashWindowEx(void)
finfo.dwFlags = FLASHW_STOP; finfo.dwFlags = FLASHW_STOP;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo); ret = pFlashWindowEx(&finfo);
todo_wine
ok(prev != ret, "previous window state should be different\n"); ok(prev != ret, "previous window state should be different\n");
DestroyWindow( hwnd ); DestroyWindow( hwnd );
......
...@@ -3413,17 +3413,45 @@ BOOL WINAPI AnyPopup(void) ...@@ -3413,17 +3413,45 @@ BOOL WINAPI AnyPopup(void)
*/ */
BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert ) BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
{ {
FLASHWINFO finfo;
finfo.cbSize = sizeof(FLASHWINFO);
finfo.dwFlags = bInvert ? FLASHW_ALL : FLASHW_STOP;
finfo.uCount = 1;
finfo.dwTimeout = 0;
finfo.hwnd = hWnd;
return FlashWindowEx( &finfo );
}
/*******************************************************************
* FlashWindowEx (USER32.@)
*/
BOOL WINAPI FlashWindowEx( PFLASHWINFO pfinfo )
{
WND *wndPtr; WND *wndPtr;
TRACE("%p\n", hWnd); TRACE( "%p\n", pfinfo->hwnd );
if (!pfinfo)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (!pfinfo->hwnd || pfinfo->cbSize != sizeof(FLASHWINFO) || !IsWindow( pfinfo->hwnd ))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
FIXME( "%p - semi-stub\n", pfinfo );
if (IsIconic( hWnd )) if (IsIconic( pfinfo->hwnd ))
{ {
RedrawWindow( hWnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME ); RedrawWindow( pfinfo->hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME );
wndPtr = WIN_GetPtr(hWnd); wndPtr = WIN_GetPtr( pfinfo->hwnd );
if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE; if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
if (bInvert && !(wndPtr->flags & WIN_NCACTIVATED)) if (pfinfo->dwFlags && !(wndPtr->flags & WIN_NCACTIVATED))
{ {
wndPtr->flags |= WIN_NCACTIVATED; wndPtr->flags |= WIN_NCACTIVATED;
} }
...@@ -3437,30 +3465,22 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert ) ...@@ -3437,30 +3465,22 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
else else
{ {
WPARAM wparam; WPARAM wparam;
HWND hwnd = pfinfo->hwnd;
wndPtr = WIN_GetPtr(hWnd); wndPtr = WIN_GetPtr( hwnd );
if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE; if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
hWnd = wndPtr->obj.handle; /* make it a full handle */ hwnd = wndPtr->obj.handle; /* make it a full handle */
if (bInvert) wparam = !(wndPtr->flags & WIN_NCACTIVATED); if (pfinfo->dwFlags) wparam = !(wndPtr->flags & WIN_NCACTIVATED);
else wparam = (hWnd == GetForegroundWindow()); else wparam = (hwnd == GetForegroundWindow());
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
SendMessageW( hWnd, WM_NCACTIVATE, wparam, 0 ); SendMessageW( hwnd, WM_NCACTIVATE, wparam, 0 );
return wparam; return wparam;
} }
} }
/******************************************************************* /*******************************************************************
* FlashWindowEx (USER32.@)
*/
BOOL WINAPI FlashWindowEx( PFLASHWINFO pfwi )
{
FIXME("%p\n", pfwi);
return TRUE;
}
/*******************************************************************
* GetWindowContextHelpId (USER32.@) * GetWindowContextHelpId (USER32.@)
*/ */
DWORD WINAPI GetWindowContextHelpId( HWND hwnd ) DWORD WINAPI GetWindowContextHelpId( HWND hwnd )
......
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