Tricky Dialog...
-
In my dialog-based application I use some other (modeless) dialogs-boxes that have the same size than my parent and aligning exactly centered in my frame-dialog when appearing. ( created with MyDialog->Create() ). For this behavior I had to use the style 'Child' in the dialog-editor. For some reason I need one dialog to appear MODAL and so I created the dialog with MyDialog->DoModal(). If I leave the style 'Child' the dialog totally locks the application when appearing. So I changed the style to 'Popup'... Now it worked ALMOST like a charm. One problem left: When I open the modal dialog it is exactly aligned relative to its parent window. When I move the parent dialog but still visible on the screen and then open the modal dialog it also aligns correctly. But from the moment I move my parent out of the screen so that e.g. only a part of my parent is visible the modal dialog appears fully visible docked to the edge of the screen but not aligned to the parent anymore. Is there any workaround or setting that the modal dialog appears aligned to my parent even if I move my parent out of the visible part of the screen. As I created all my dialogs in the application with thin borders and no title-bar you do never realize that with every view-change a new dialog is created. Only in the above mentioned situation the thin boarderd-modal-dialog stands alone on the screen - looking ugly... Any Ideas on that ? Manfred --- 'Programming is knowing...'
-
In my dialog-based application I use some other (modeless) dialogs-boxes that have the same size than my parent and aligning exactly centered in my frame-dialog when appearing. ( created with MyDialog->Create() ). For this behavior I had to use the style 'Child' in the dialog-editor. For some reason I need one dialog to appear MODAL and so I created the dialog with MyDialog->DoModal(). If I leave the style 'Child' the dialog totally locks the application when appearing. So I changed the style to 'Popup'... Now it worked ALMOST like a charm. One problem left: When I open the modal dialog it is exactly aligned relative to its parent window. When I move the parent dialog but still visible on the screen and then open the modal dialog it also aligns correctly. But from the moment I move my parent out of the screen so that e.g. only a part of my parent is visible the modal dialog appears fully visible docked to the edge of the screen but not aligned to the parent anymore. Is there any workaround or setting that the modal dialog appears aligned to my parent even if I move my parent out of the visible part of the screen. As I created all my dialogs in the application with thin borders and no title-bar you do never realize that with every view-change a new dialog is created. Only in the above mentioned situation the thin boarderd-modal-dialog stands alone on the screen - looking ugly... Any Ideas on that ? Manfred --- 'Programming is knowing...'
> Is there any workaround or setting that the modal dialog appears aligned to my parent > even if I move my parent out of the visible part of the screen. How about obtaining the geometry of your parent window when processing WM_INITDIALOG, and use SetWindowPos() or similar on the modal dialog to the coreect location? Peace! -=- James.
-
In my dialog-based application I use some other (modeless) dialogs-boxes that have the same size than my parent and aligning exactly centered in my frame-dialog when appearing. ( created with MyDialog->Create() ). For this behavior I had to use the style 'Child' in the dialog-editor. For some reason I need one dialog to appear MODAL and so I created the dialog with MyDialog->DoModal(). If I leave the style 'Child' the dialog totally locks the application when appearing. So I changed the style to 'Popup'... Now it worked ALMOST like a charm. One problem left: When I open the modal dialog it is exactly aligned relative to its parent window. When I move the parent dialog but still visible on the screen and then open the modal dialog it also aligns correctly. But from the moment I move my parent out of the screen so that e.g. only a part of my parent is visible the modal dialog appears fully visible docked to the edge of the screen but not aligned to the parent anymore. Is there any workaround or setting that the modal dialog appears aligned to my parent even if I move my parent out of the visible part of the screen. As I created all my dialogs in the application with thin borders and no title-bar you do never realize that with every view-change a new dialog is created. Only in the above mentioned situation the thin boarderd-modal-dialog stands alone on the screen - looking ugly... Any Ideas on that ? Manfred --- 'Programming is knowing...'
> Is there any workaround or setting that the modal dialog appears aligned to my parent > even if I move my parent out of the visible part of the screen. How about obtaining the geometry of your parent window when processing WM_INITDIALOG, and use SetWindowPos() or similar on the modal dialog to the coreect location? Peace! -=- James.
-
In my dialog-based application I use some other (modeless) dialogs-boxes that have the same size than my parent and aligning exactly centered in my frame-dialog when appearing. ( created with MyDialog->Create() ). For this behavior I had to use the style 'Child' in the dialog-editor. For some reason I need one dialog to appear MODAL and so I created the dialog with MyDialog->DoModal(). If I leave the style 'Child' the dialog totally locks the application when appearing. So I changed the style to 'Popup'... Now it worked ALMOST like a charm. One problem left: When I open the modal dialog it is exactly aligned relative to its parent window. When I move the parent dialog but still visible on the screen and then open the modal dialog it also aligns correctly. But from the moment I move my parent out of the screen so that e.g. only a part of my parent is visible the modal dialog appears fully visible docked to the edge of the screen but not aligned to the parent anymore. Is there any workaround or setting that the modal dialog appears aligned to my parent even if I move my parent out of the visible part of the screen. As I created all my dialogs in the application with thin borders and no title-bar you do never realize that with every view-change a new dialog is created. Only in the above mentioned situation the thin boarderd-modal-dialog stands alone on the screen - looking ugly... Any Ideas on that ? Manfred --- 'Programming is knowing...'
> Is there any workaround or setting that the modal dialog appears aligned to my parent > even if I move my parent out of the visible part of the screen. How about obtaining the geometry of your parent window when processing WM_INITDIALOG, and use SetWindowPos() or similar on the modal dialog to the coreect location? Peace! -=- James.