Replace some SendMessage with SendNotifyMessage in case the target

window belongs to another thread.
This commit is contained in:
François Gouget 2002-04-06 00:40:41 +00:00 committed by Alexandre Julliard
parent a5e9bf7321
commit 392f6f8775
2 changed files with 5 additions and 9 deletions

View File

@ -42,7 +42,8 @@ void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND hFocusFrom, HWND hFocusTo )
{
PERQDATA_SetFocusWnd( pMsgQ->pQData, hFocusTo );
if (hFocusFrom) SendMessageA( hFocusFrom, WM_KILLFOCUS, (WPARAM)hFocusTo, 0 );
if (hFocusFrom)
SendNotifyMessageA( hFocusFrom, WM_KILLFOCUS, (WPARAM)hFocusTo, 0 );
if( !hFocusTo || hFocusTo != PERQDATA_GetFocusWnd( pMsgQ->pQData ) )
{

View File

@ -1247,14 +1247,9 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
if ((hwndPrevActive = hwndActive) && IsWindow(hwndPrevActive))
{
MESSAGEQUEUE *pTempActiveQueue = 0;
if (!SendMessageA( hwndPrevActive, WM_NCACTIVATE, FALSE, 0 ))
{
if (GetSysModalWindow16() != WIN_Handle16(hWnd)) goto CLEANUP_END;
/* disregard refusal if hWnd is sysmodal */
}
SendMessageA( hwndPrevActive, WM_ACTIVATE,
SendNotifyMessageA( hwndPrevActive, WM_NCACTIVATE, FALSE, 0 );
SendNotifyMessageA( hwndPrevActive, WM_ACTIVATE,
MAKEWPARAM( WA_INACTIVE, wIconized ),
(LPARAM)hWnd );
@ -1321,7 +1316,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
{
if (!IsWindow( *phwnd )) continue;
if (GetWindowThreadProcessId( *phwnd, NULL ) == old_thread)
SendMessageW( *phwnd, WM_ACTIVATEAPP, 0, new_thread );
SendNotifyMessageW( *phwnd, WM_ACTIVATEAPP, 0, new_thread );
}
HeapFree( GetProcessHeap(), 0, list );
}