Is my App displaying a message box?
-
I want to know (programatically, of course: I am not blind!) if my application is displaying a MessageBox() or otherwise engaged in a modal dialog. The context of the question is this: I am in a CView* and I want to do something to the user interface. I need to know if my application is "busy" waiting for a modal dialog before I can proceed with my changes ??? I have tried GetActiveView() and it tells me if "this" view is the current "top" view. (I run modal loops in my views) so this is coverd. I am about to try GetFocus() then GetOwnerWnd()... Maybe someone already has the answer??
-
I want to know (programatically, of course: I am not blind!) if my application is displaying a MessageBox() or otherwise engaged in a modal dialog. The context of the question is this: I am in a CView* and I want to do something to the user interface. I need to know if my application is "busy" waiting for a modal dialog before I can proceed with my changes ??? I have tried GetActiveView() and it tells me if "this" view is the current "top" view. (I run modal loops in my views) so this is coverd. I am about to try GetFocus() then GetOwnerWnd()... Maybe someone already has the answer??
-
I got it, I think! GetLastActivePopup() I wonder where I was for the last XX years, I tought I knew WIN32. It goes to show, you learn something every day!
-
OOps. this is not good: GetLastActivePopup() still returns my VIEW's HWND instead of that of the MessageBox() :( I guess I can either (a) keep looking or (b) find someone smarter than me to give me the answer!
-
I tapught about that. The problem is that ma application has maybe 100 views or screens, and I want beautiful code, not a quick hack. Whatever would force me to spend lots of time working like a robot is not a great idea. I may capture all invokation of message boxes and dialog boxes, but as I (or someone else) maintain my applicatio, I am scared to "forget" about it. If I could use WIN32 to tell me is a messagebox is up and running, I write once and can rely on that no matter how my stuff is written, putting the logic in a base-class somewhere.