When my app fires an event, I need to know if at that time I have a MessageDlg (or some other system dialog) open.How to figure that out?
When my app fires an event, I need to know if at that time I have a MessageDlg (or some other system dialog) open.
There is Code: Pascal [Select][+][-]function GetCurrentModalForm: TCustomForm;
Presuming your question is on Windows ...
... and that the MessageDlg is owned by your application (not the desktop for instance)
Application dialogs - by (Application.ModalLevel > 0). System dialogs - using System API.
Quote from: ASerge on July 09, 2020, 03:42:32 pmApplication dialogs - by (Application.ModalLevel > 0). System dialogs - using System API.My fault: I mean the dialog shown by MessageDlg() or ShowMessage() functions.
Quote from: Bart on July 09, 2020, 06:53:52 pmQuote from: ASerge on July 09, 2020, 03:42:32 pmApplication dialogs - by (Application.ModalLevel > 0). System dialogs - using System API.My fault: I mean the dialog shown by MessageDlg() or ShowMessage() functions.So Application.ModalLevel > 0.