user32: Use the original owner used to create the dialog for WM_ENTERIDLE messages.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-04-06 14:41:27 +02:00 committed by Alexandre Julliard
parent fc4b906d78
commit 36b64321b2
4 changed files with 16 additions and 16 deletions

View File

@ -744,7 +744,7 @@ INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, LPCSTR template,
{
HWND owner = WIN_Handle32(owner16);
hwnd = DIALOG_CreateIndirect16( hInst, data, owner, dlgProc, param, TRUE );
if (hwnd) ret = wow_handlers32.dialog_box_loop( hwnd );
if (hwnd) ret = wow_handlers32.dialog_box_loop( hwnd, owner );
GlobalUnlock16( hmem );
}
FreeResource16( hmem );
@ -764,7 +764,7 @@ INT16 WINAPI DialogBoxIndirectParam16( HINSTANCE16 hInst, HANDLE16 dlgTemplate,
if (!(ptr = GlobalLock16( dlgTemplate ))) return -1;
hwnd = DIALOG_CreateIndirect16( hInst, ptr, owner, dlgProc, param, TRUE );
GlobalUnlock16( dlgTemplate );
if (hwnd) return wow_handlers32.dialog_box_loop( hwnd );
if (hwnd) return wow_handlers32.dialog_box_loop( hwnd, owner );
return -1;
}

View File

@ -63,7 +63,7 @@ struct wow_handlers32
HWND (*get_win_handle)(HWND);
WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
INT (*dialog_box_loop)(HWND);
INT (*dialog_box_loop)(HWND,HWND);
ULONG_PTR (*get_icon_param)(HICON);
ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR);
};

View File

@ -121,7 +121,7 @@ struct wow_handlers32
HWND (*get_win_handle)(HWND);
WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
INT (*dialog_box_loop)(HWND);
INT (*dialog_box_loop)(HWND,HWND);
ULONG_PTR (*get_icon_param)(HICON);
ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR);
};
@ -243,7 +243,7 @@ typedef struct tagDIALOGINFO
#define DF_END 0x0001
extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
extern INT DIALOG_DoDialogBox( HWND hwnd ) DECLSPEC_HIDDEN;
extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
HRGN set_control_clipping( HDC hdc, const RECT *rect ) DECLSPEC_HIDDEN;

View File

@ -445,7 +445,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
*/
static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
HWND owner, DLGPROC dlgProc, LPARAM param,
BOOL unicode, BOOL modal )
BOOL unicode, HWND *modal_owner )
{
HWND hwnd;
RECT rect;
@ -584,7 +584,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
}
}
if (modal && owner)
if (modal_owner && owner)
{
HWND parent;
/*
@ -599,6 +599,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (!parent || parent == GetDesktopWindow()) break;
owner = parent;
}
*modal_owner = owner;
if (IsWindowEnabled( owner ))
{
disabled_owner = owner;
@ -768,9 +769,8 @@ HWND WINAPI CreateDialogIndirectParamW( HINSTANCE hInst, LPCDLGTEMPLATEW dlgTemp
/***********************************************************************
* DIALOG_DoDialogBox
*/
INT DIALOG_DoDialogBox( HWND hwnd )
INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
{
HWND owner = GetWindow( hwnd, GW_OWNER );
DIALOGINFO * dlgInfo;
MSG msg;
INT retval;
@ -792,7 +792,7 @@ INT DIALOG_DoDialogBox( HWND hwnd )
bFirstEmpty = FALSE;
}
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & DS_NOIDLEMSG))
{
{
/* No message present -> send ENTERIDLE and wait */
SendMessageW( owner, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd );
}
@ -839,8 +839,8 @@ INT_PTR WINAPI DialogBoxParamA( HINSTANCE hInst, LPCSTR name,
if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG ))) return -1;
if (!(ptr = LoadResource(hInst, hrsrc))) return -1;
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, FALSE, TRUE );
if (hwnd) return DIALOG_DoDialogBox( hwnd );
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, FALSE, &owner );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
return 0;
}
@ -857,8 +857,8 @@ INT_PTR WINAPI DialogBoxParamW( HINSTANCE hInst, LPCWSTR name,
if (!(hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ))) return -1;
if (!(ptr = LoadResource(hInst, hrsrc))) return -1;
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, TRUE, TRUE );
if (hwnd) return DIALOG_DoDialogBox( hwnd );
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, TRUE, &owner );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
return 0;
}
@ -870,8 +870,8 @@ INT_PTR WINAPI DialogBoxIndirectParamAorW( HINSTANCE hInstance, LPCVOID template
HWND owner, DLGPROC dlgProc,
LPARAM param, DWORD flags )
{
HWND hwnd = DIALOG_CreateIndirect( hInstance, template, owner, dlgProc, param, !flags, TRUE );
if (hwnd) return DIALOG_DoDialogBox( hwnd );
HWND hwnd = DIALOG_CreateIndirect( hInstance, template, owner, dlgProc, param, !flags, &owner );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
return -1;
}