use WS_EX_DIALOGBOX style for IsDialog() instead of sending message to window procedure

This commit is contained in:
Vincent Wei
2020-02-21 20:05:44 +08:00
parent a3b76f2f9d
commit 3e3a7c92e1
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -194,6 +194,9 @@ int GUIAPI DialogBoxIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
if (hDlg == HWND_INVALID)
return -1;
/* Since 5.0.0: use internal extended style for dialgbox */
IncludeWindowExStyle (hDlg, WS_EX_DIALOGBOX);
//MiniGUI maybe change dialog owner in CreateMainWindow, so we
//should update its owner by GetHosting.
hOwner = GetHosting (hDlg);
+10
View File
@@ -2928,7 +2928,17 @@ BOOL GUIAPI IsControl (HWND hWnd)
BOOL GUIAPI IsDialog (HWND hWnd)
{
#if 0 /* Since 5.0.0: use the internal extended style WS_EX_DIALOGBOX */
return (BOOL)SendAsyncMessage (hWnd, MSG_ISDIALOG, 0, 0);
#else /* deprecated code */
PMAINWIN pWin;
MG_CHECK_RET (MG_IS_MAIN_WINDOW(hWnd), FALSE);
pWin = MG_GET_WINDOW_PTR(hWnd);
return (pWin->dwExStyle & WS_EX_DIALOGBOX);
#endif /* Since 5.0.0: use the internal extended style WS_EX_DIALOGBOX */
}
HWND GUIAPI GetMainWindowHandle (HWND hWnd)