Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Tricky Dialog...

Tricky Dialog...

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Manfred Ramosch
    wrote on last edited by
    #1

    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...'

    J 3 Replies Last reply
    0
    • M Manfred Ramosch

      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...'

      J Offline
      J Offline
      James R Twine
      wrote on last edited by
      #2

      > 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.

      1 Reply Last reply
      0
      • M Manfred Ramosch

        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...'

        J Offline
        J Offline
        James R Twine
        wrote on last edited by
        #3

        > 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.

        1 Reply Last reply
        0
        • M Manfred Ramosch

          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...'

          J Offline
          J Offline
          James R Twine
          wrote on last edited by
          #4

          > 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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups