Delphi - detecting if my app has a modal dialog open

牧云@^-^@ 提交于 2019-12-06 09:27:57

Just test

if not IsWindowEnabled(MyMainWindow.Handle) then

This would also take care of situtations when a non-Delphi dialog is acting modal, like in windows.MessageBox(Handle.... or a common dialog is showing (i.e. a TOpenDialog).

histrio

use AnyPopup() function

About GetLastActivePopup(). It may return value is the same as the hWnd parameter when

  • The window identified by hWnd was most recently active.
  • The window identified by hWnd does not own any pop-up windows.
  • The window identifies by hWnd is not a top-level window, or it is owned by another window.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!