hi,
I need to recognize whether any modal form is currently opened in my application, either an own form or any message window. I need this because my application should react to a message from another task, but only if it's "idle", that is the user didn't open any modal dialog.
I tried this trick in my GetMessage procedure inside my main form:
..
SetFocus;
if not Self.Active then
exit;
..
I assumed this should work to determine whether any modal window prevents giving focus to the main window. But sometimes it fails for some strange reason (my debugger then says the main form is active).
So is there any other way to determine whether a modal form is currently open ?
regards
Rod
I need to recognize whether any modal form is currently opened in my application, either an own form or any message window. I need this because my application should react to a message from another task, but only if it's "idle", that is the user didn't open any modal dialog.
I tried this trick in my GetMessage procedure inside my main form:
..
SetFocus;
if not Self.Active then
exit;
..
I assumed this should work to determine whether any modal window prevents giving focus to the main window. But sometimes it fails for some strange reason (my debugger then says the main form is active).
So is there any other way to determine whether a modal form is currently open ?
regards
Rod