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. How to move window with no border using picture control

How to move window with no border using picture control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
7 Posts 4 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.
  • P Offline
    P Offline
    Premnath Mali
    wrote on last edited by
    #1

    I have one dialog without border and on it i have one picture control I wanted to move the window using picture control like we are moving using title bar

    L D L 3 Replies Last reply
    0
    • P Premnath Mali

      I have one dialog without border and on it i have one picture control I wanted to move the window using picture control like we are moving using title bar

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Exactly what do you want to move, and how? Do you want to move the picture within the dialog using the mouse, or some other feature? Or do you want to move the entire dialog?

      P 1 Reply Last reply
      0
      • L Lost User

        Exactly what do you want to move, and how? Do you want to move the picture within the dialog using the mouse, or some other feature? Or do you want to move the entire dialog?

        P Offline
        P Offline
        Premnath Mali
        wrote on last edited by
        #3

        Entire Dialog I want to move

        L 1 Reply Last reply
        0
        • P Premnath Mali

          Entire Dialog I want to move

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Use MoveWindow function (Windows)[^].

          1 Reply Last reply
          0
          • P Premnath Mali

            I have one dialog without border and on it i have one picture control I wanted to move the window using picture control like we are moving using title bar

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            See if this helps.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            L 1 Reply Last reply
            0
            • P Premnath Mali

              I have one dialog without border and on it i have one picture control I wanted to move the window using picture control like we are moving using title bar

              L Offline
              L Offline
              leon de boer
              wrote on last edited by
              #6

              You need to process the mouse messages in your dialog, you have to do all the work because you don't have a frame. Usually you have a select trigger, lets say that is left mouse click down (WM_LBUTTONDOWN) that sets a flag in your dialog handler. When that flag is set you process WM_MOUSEMOVE messages to actually move the the window with the mouse. Then you have a trigger to release, lets say that is left mouse button up (WM_LBUTTONUP) that clears the flag in your dialog handler. You can confine the triggers to areas on your dialog or the whole dialog just by looking at position of the trigger messages and allowing or ignoring. That is what the frame handler does and why you can't drag the dialog around without the frame. It also has triggers on the keys to allow you to size and move the window by the keys. The normal frame handler has special areas that turn triggers on/off the top bar allows dragging, the bottom right allows X,Y sizing the sides one direction sizing etc. On MDI and SDI's they call a global default handler called DefFrameProc with some structures, you can look it up on MSDN. That should give you the detail of what you need to do if you want to complete implementation. For graphical dragging and the like I only ever do the basic mouse one.

              In vino veritas

              1 Reply Last reply
              0
              • D David Crow

                See if this helps.

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Indeed. You simply needs to return HTCAPTION on the WM_NCHITTEST message. Which is OnNcHitTest in the MFC framework. Best Wishes, -David Delaune

                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