Use a timeout when sending broadcast messages.

This commit is contained in:
Alexandre Julliard 2003-10-31 04:18:55 +00:00
parent 736d96b5b3
commit 6d9350fa1f
5 changed files with 15 additions and 7 deletions

View File

@ -182,7 +182,8 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
LeaveCriticalSection(&WDML_CritSect);
/* note: sent messages shall not use packing */
SendMessageA(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc));
SendMessageTimeoutW( HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc),
SMTO_ABORTIFHUNG, 2000, NULL );
EnterCriticalSection(&WDML_CritSect);

View File

@ -110,7 +110,8 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
{
/* send palette messages */
if (SendMessageW( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
SendMessageW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0 );
SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
SMTO_ABORTIFHUNG, 2000, NULL );
if (!(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_MANAGED))
SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );

View File

@ -1467,7 +1467,8 @@ UINT WINAPI UserRealizePalette( HDC hDC )
{
/* send palette change notification */
HWND hWnd = WindowFromDC( hDC );
if (hWnd) SendMessageA( HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0L);
if (hWnd) SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0,
SMTO_ABORTIFHUNG, 2000, NULL );
}
return realized;
}

View File

@ -252,7 +252,8 @@ VOID WINAPI SetSysColors16( INT16 nChanges, const INT16 *lpSysColor,
/* Send WM_SYSCOLORCHANGE message to all windows */
SendMessageA( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0 );
SendMessageTimeoutW( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 2000, NULL );
/* Repaint affected portions of all visible windows */
@ -276,7 +277,8 @@ BOOL WINAPI SetSysColors( INT nChanges, const INT *lpSysColor,
/* Send WM_SYSCOLORCHANGE message to all windows */
SendMessageA( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0 );
SendMessageTimeoutW( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 2000, NULL );
/* Repaint affected portions of all visible windows */

View File

@ -354,13 +354,16 @@ static HKEY get_volatile_regkey(void)
*/
void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
{
static const WCHAR emptyW[1];
if (notify_change)
{
if (fWinIni & SPIF_UPDATEINIFILE)
{
if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
SendMessageA(HWND_BROADCAST, WM_SETTINGCHANGE,
uiAction, (LPARAM) "");
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE,
uiAction, (LPARAM) emptyW,
SMTO_ABORTIFHUNG, 2000, NULL );
}
else
{