Dialog window should not be destroyed in DefDlgProc; this break
modeless dialogs.
This commit is contained in:
parent
57f96abee0
commit
cb8ef7d2bb
|
@ -38,7 +38,6 @@ typedef struct
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
|
|
||||||
#define DF_END 0x0001
|
#define DF_END 0x0001
|
||||||
#define DF_ENDING 0x0002
|
|
||||||
|
|
||||||
extern BOOL32 DIALOG_Init(void);
|
extern BOOL32 DIALOG_Init(void);
|
||||||
extern HWND32 DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
|
extern HWND32 DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
|
||||||
|
|
|
@ -266,12 +266,6 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
|
||||||
/* 16 bit dlg procs only return BOOL16 */
|
/* 16 bit dlg procs only return BOOL16 */
|
||||||
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
||||||
result = LOWORD(result);
|
result = LOWORD(result);
|
||||||
|
|
||||||
/* Check if window was destroyed by dialog procedure */
|
|
||||||
if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
|
|
||||||
dlgInfo->flags |= DF_ENDING;
|
|
||||||
DestroyWindow32( hwnd );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result && IsWindow32(hwnd))
|
if (!result && IsWindow32(hwnd))
|
||||||
|
@ -329,12 +323,6 @@ LRESULT WINAPI DefDlgProc32A( HWND32 hwnd, UINT32 msg,
|
||||||
/* 16 bit dlg procs only return BOOL16 */
|
/* 16 bit dlg procs only return BOOL16 */
|
||||||
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
||||||
result = LOWORD(result);
|
result = LOWORD(result);
|
||||||
|
|
||||||
/* Check if window was destroyed by dialog procedure */
|
|
||||||
if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
|
|
||||||
dlgInfo->flags |= DF_ENDING;
|
|
||||||
DestroyWindow32( hwnd );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result && IsWindow32(hwnd))
|
if (!result && IsWindow32(hwnd))
|
||||||
|
@ -392,12 +380,6 @@ LRESULT WINAPI DefDlgProc32W( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
|
||||||
/* 16 bit dlg procs only return BOOL16 */
|
/* 16 bit dlg procs only return BOOL16 */
|
||||||
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
|
||||||
result = LOWORD(result);
|
result = LOWORD(result);
|
||||||
|
|
||||||
/* Check if window was destroyed by dialog procedure */
|
|
||||||
if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
|
|
||||||
dlgInfo->flags |= DF_ENDING;
|
|
||||||
DestroyWindow32( hwnd );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result && IsWindow32(hwnd))
|
if (!result && IsWindow32(hwnd))
|
||||||
|
|
|
@ -869,7 +869,6 @@ INT32 DIALOG_DoDialogBox( HWND32 hwnd, HWND32 owner )
|
||||||
}
|
}
|
||||||
retval = dlgInfo->idResult;
|
retval = dlgInfo->idResult;
|
||||||
EnableWindow32( owner, TRUE );
|
EnableWindow32( owner, TRUE );
|
||||||
dlgInfo->flags |= DF_ENDING; /* try to stop it being destroyed twice */
|
|
||||||
DestroyWindow32( hwnd );
|
DestroyWindow32( hwnd );
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue