To be modal or not to be modal
-
Hi all. In an earlier question I indicated that I generate child dialog by means of "Create". However; when defining a new entry I prefer to use a modal dialog for a number of reasons. This means that - for example - in the OnOK routine, I can have a modal dialog or not; which means that I need to react differently. Anyone have any idea how to find out if the dialog is modal or not? I could of course set a flag myself (since I know how I am creating the dialog) but isn't there a neat way of doing this? Thanks in advance William
-
Hi all. In an earlier question I indicated that I generate child dialog by means of "Create". However; when defining a new entry I prefer to use a modal dialog for a number of reasons. This means that - for example - in the OnOK routine, I can have a modal dialog or not; which means that I need to react differently. Anyone have any idea how to find out if the dialog is modal or not? I could of course set a flag myself (since I know how I am creating the dialog) but isn't there a neat way of doing this? Thanks in advance William
If you are using MFC, modal dialogs are implemented a little differently - they simply disable their parent window. You should be able to get a dialog's parent window handle (
HWND
), and then see if it is disabled or not. Not really neat, but it may work for you. Might just be better to set a flag! Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles -
If you are using MFC, modal dialogs are implemented a little differently - they simply disable their parent window. You should be able to get a dialog's parent window handle (
HWND
), and then see if it is disabled or not. Not really neat, but it may work for you. Might just be better to set a flag! Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFilesJames, Thanks for your answer. I have now indeed introduced a flag, which is set in an overridden DoModal routine. Works just fine. Thanks, William