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. Modeless dialogs off the beaten track

Modeless dialogs off the beaten track

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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.
  • R Offline
    R Offline
    richiebabes
    wrote on last edited by
    #1

    How can I control my modeless dialogs when they are moved? They can be moved all over the place, off the main window into the wide blue yonder. How can I make sure they only stay within the bounds of the main window (which itself can be resized)?

    S RaviBeeR R 4 Replies Last reply
    0
    • R richiebabes

      How can I control my modeless dialogs when they are moved? They can be moved all over the place, off the main window into the wide blue yonder. How can I make sure they only stay within the bounds of the main window (which itself can be resized)?

      S Offline
      S Offline
      Steve Mayfield
      wrote on last edited by
      #2

      Override the WM_MOVE windows message with OnMove() in your dialog class and use the parent window bounding rect to limit the movement. Steve

      1 Reply Last reply
      0
      • R richiebabes

        How can I control my modeless dialogs when they are moved? They can be moved all over the place, off the main window into the wide blue yonder. How can I make sure they only stay within the bounds of the main window (which itself can be resized)?

        RaviBeeR Offline
        RaviBeeR Offline
        RaviBee
        wrote on last edited by
        #3

        See WM_MOVING (to restrict the movement of a window) or WM_MOVE (to reset the position of a window after it's been moved). /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        1 Reply Last reply
        0
        • R richiebabes

          How can I control my modeless dialogs when they are moved? They can be moved all over the place, off the main window into the wide blue yonder. How can I make sure they only stay within the bounds of the main window (which itself can be resized)?

          R Offline
          R Offline
          richiebabes
          wrote on last edited by
          #4

          I did it with OnMoving. Great - I can stop the user moving the dialog off the main window. But now what if I want the user to move it off the window but make the part off the window invisible?

          1 Reply Last reply
          0
          • R richiebabes

            How can I control my modeless dialogs when they are moved? They can be moved all over the place, off the main window into the wide blue yonder. How can I make sure they only stay within the bounds of the main window (which itself can be resized)?

            R Offline
            R Offline
            richiebabes
            wrote on last edited by
            #5

            And also is there a way to get a window rect that only gives you the coords of the actual view, i.e. ignores the title bar, status bar etc?

            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