Use a timeout when sending broadcast messages.
This commit is contained in:
parent
736d96b5b3
commit
6d9350fa1f
|
@ -182,7 +182,8 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
|
||||||
LeaveCriticalSection(&WDML_CritSect);
|
LeaveCriticalSection(&WDML_CritSect);
|
||||||
|
|
||||||
/* note: sent messages shall not use packing */
|
/* 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);
|
EnterCriticalSection(&WDML_CritSect);
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,8 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
|
||||||
{
|
{
|
||||||
/* send palette messages */
|
/* send palette messages */
|
||||||
if (SendMessageW( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
|
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))
|
if (!(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_MANAGED))
|
||||||
SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
|
SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
|
||||||
|
|
|
@ -1467,7 +1467,8 @@ UINT WINAPI UserRealizePalette( HDC hDC )
|
||||||
{
|
{
|
||||||
/* send palette change notification */
|
/* send palette change notification */
|
||||||
HWND hWnd = WindowFromDC( hDC );
|
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;
|
return realized;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,8 @@ VOID WINAPI SetSysColors16( INT16 nChanges, const INT16 *lpSysColor,
|
||||||
|
|
||||||
/* Send WM_SYSCOLORCHANGE message to all windows */
|
/* 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 */
|
/* 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 */
|
/* 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 */
|
/* Repaint affected portions of all visible windows */
|
||||||
|
|
||||||
|
|
|
@ -354,13 +354,16 @@ static HKEY get_volatile_regkey(void)
|
||||||
*/
|
*/
|
||||||
void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
|
void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
|
||||||
{
|
{
|
||||||
|
static const WCHAR emptyW[1];
|
||||||
|
|
||||||
if (notify_change)
|
if (notify_change)
|
||||||
{
|
{
|
||||||
if (fWinIni & SPIF_UPDATEINIFILE)
|
if (fWinIni & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
|
if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
|
||||||
SendMessageA(HWND_BROADCAST, WM_SETTINGCHANGE,
|
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE,
|
||||||
uiAction, (LPARAM) "");
|
uiAction, (LPARAM) emptyW,
|
||||||
|
SMTO_ABORTIFHUNG, 2000, NULL );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue