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 Rollup a Window

How to Rollup a Window

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++designtutorial
13 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.
  • A Offline
    A Offline
    Atlantys
    wrote on last edited by
    #1

    No, this is not a question about cars:-D I would like to add functionality to my MFC dialog so that the user can click a button to make the window "rollup". Similar to the middle top-right button in Winamp. Anyone have any ideas on this? I'd prefer it if I could make the design similar to Winamp in that a "new" dialog is shown as the "rolled up" window, but if this is not possible, then just showing the title bar is acceptable (I suppose). I assume doing it this second way would just be resizing dialog to something slightly bigger than the titlebar, now that I think about it. :( TIA.:-D

    PJ ArendsP J 2 Replies Last reply
    0
    • A Atlantys

      No, this is not a question about cars:-D I would like to add functionality to my MFC dialog so that the user can click a button to make the window "rollup". Similar to the middle top-right button in Winamp. Anyone have any ideas on this? I'd prefer it if I could make the design similar to Winamp in that a "new" dialog is shown as the "rolled up" window, but if this is not possible, then just showing the title bar is acceptable (I suppose). I assume doing it this second way would just be resizing dialog to something slightly bigger than the titlebar, now that I think about it. :( TIA.:-D

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      Having never seen Winamp, I am not sure what you want, but is this <clickety> what you are looking for?


      CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      A 1 Reply Last reply
      0
      • PJ ArendsP PJ Arends

        Having never seen Winamp, I am not sure what you want, but is this <clickety> what you are looking for?


        CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

        A Offline
        A Offline
        Atlantys
        wrote on last edited by
        #3

        That's *sort of* what I mean, but I'm looking to rollup the whole app (so it's just like the Minimize or Close system buttons), instead of a just child window of a larger app. PJ Arends wrote: Having never seen Winamp :omg::wtf: What do you use for mp3s then?? please don't say WMP7. :-D

        PJ ArendsP 2 Replies Last reply
        0
        • A Atlantys

          No, this is not a question about cars:-D I would like to add functionality to my MFC dialog so that the user can click a button to make the window "rollup". Similar to the middle top-right button in Winamp. Anyone have any ideas on this? I'd prefer it if I could make the design similar to Winamp in that a "new" dialog is shown as the "rolled up" window, but if this is not possible, then just showing the title bar is acceptable (I suppose). I assume doing it this second way would just be resizing dialog to something slightly bigger than the titlebar, now that I think about it. :( TIA.:-D

          J Offline
          J Offline
          JohnnyG
          wrote on last edited by
          #4

          It can't be that hard. Why not use SetWindowPos( ) keeping the left and top coordinates the same and resize the height and/or width of the window?

          J A 2 Replies Last reply
          0
          • J JohnnyG

            It can't be that hard. Why not use SetWindowPos( ) keeping the left and top coordinates the same and resize the height and/or width of the window?

            J Offline
            J Offline
            JohnnyG
            wrote on last edited by
            #5

            BTW, I recently D/L'd Paint Shop Pro 7.0 and all of it's floating toolbar windows are rolled up that way but when you put the mouse over the caption or title, it restores itself to it's previous size. Cool!

            1 Reply Last reply
            0
            • J JohnnyG

              It can't be that hard. Why not use SetWindowPos( ) keeping the left and top coordinates the same and resize the height and/or width of the window?

              A Offline
              A Offline
              Atlantys
              wrote on last edited by
              #6

              That's what I was initially thinking, but that doesn't allow me to make the "rolled up" window have a different template. It'll just make the current window smaller, eh? If you'll notice what they do in Winamp (sorry, only program I know that has this feature), when it is rolled up, the title bar changes and buttons are added. Which is what i'm going for. The idea behind this is: the user can make the window as small as necessary without sacrificing the ability to use the more important functions (and Minimize makes the window disappear completely).

              J B 3 Replies Last reply
              0
              • A Atlantys

                That's *sort of* what I mean, but I'm looking to rollup the whole app (so it's just like the Minimize or Close system buttons), instead of a just child window of a larger app. PJ Arends wrote: Having never seen Winamp :omg::wtf: What do you use for mp3s then?? please don't say WMP7. :-D

                PJ ArendsP Offline
                PJ ArendsP Offline
                PJ Arends
                wrote on last edited by
                #7

                :confused:mp3s:confused: I actually prefer talk radio. This <clickety> radio station is left on 24/7 in my house.;)


                CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

                Within you lies the power for good; Use it!

                A 1 Reply Last reply
                0
                • A Atlantys

                  That's what I was initially thinking, but that doesn't allow me to make the "rolled up" window have a different template. It'll just make the current window smaller, eh? If you'll notice what they do in Winamp (sorry, only program I know that has this feature), when it is rolled up, the title bar changes and buttons are added. Which is what i'm going for. The idea behind this is: the user can make the window as small as necessary without sacrificing the ability to use the more important functions (and Minimize makes the window disappear completely).

                  J Offline
                  J Offline
                  JohnnyG
                  wrote on last edited by
                  #8

                  Yes, it will make it smaller but you can shrink it down to the title bar size only which is what you want, right? I think you need to set CS_OWNERDRAW and draw the title bar yourself if you want buttons. Search this site and others for examples.

                  1 Reply Last reply
                  0
                  • PJ ArendsP PJ Arends

                    :confused:mp3s:confused: I actually prefer talk radio. This <clickety> radio station is left on 24/7 in my house.;)


                    CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

                    A Offline
                    A Offline
                    Atlantys
                    wrote on last edited by
                    #9

                    From BC I take it? I call Victoria home, but right now I'm in a little town called Kitchener/Waterloo for a few more (hellish) years.:-D:-D

                    PJ ArendsP 1 Reply Last reply
                    0
                    • A Atlantys

                      From BC I take it? I call Victoria home, but right now I'm in a little town called Kitchener/Waterloo for a few more (hellish) years.:-D:-D

                      PJ ArendsP Offline
                      PJ ArendsP Offline
                      PJ Arends
                      wrote on last edited by
                      #10

                      Atlantys wrote: From BC I take it? Abbotsford. Atlantys wrote: I call Victoria home, but right now I'm in a little town called Kitchener/Waterloo for a few more (hellish) years. Oh man:(, you gotta come back to lotusland, the weather is great:-D:-D


                      CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

                      Within you lies the power for good; Use it!

                      1 Reply Last reply
                      0
                      • A Atlantys

                        That's *sort of* what I mean, but I'm looking to rollup the whole app (so it's just like the Minimize or Close system buttons), instead of a just child window of a larger app. PJ Arends wrote: Having never seen Winamp :omg::wtf: What do you use for mp3s then?? please don't say WMP7. :-D

                        PJ ArendsP Offline
                        PJ ArendsP Offline
                        PJ Arends
                        wrote on last edited by
                        #11

                        I would think it could work if you used a dialog template for the minimized window, just remove the title bar. When your app is "minimized", just destroy your main window, and recreate your main window using your minimized dialog. Of course this would be a lot easier to implement if your main window is also a dialog;P. If you want the window to visible shrink, you would have to use a timer and SetWindowPos().


                        CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

                        Within you lies the power for good; Use it!

                        1 Reply Last reply
                        0
                        • A Atlantys

                          That's what I was initially thinking, but that doesn't allow me to make the "rolled up" window have a different template. It'll just make the current window smaller, eh? If you'll notice what they do in Winamp (sorry, only program I know that has this feature), when it is rolled up, the title bar changes and buttons are added. Which is what i'm going for. The idea behind this is: the user can make the window as small as necessary without sacrificing the ability to use the more important functions (and Minimize makes the window disappear completely).

                          J Offline
                          J Offline
                          JohnnyG
                          wrote on last edited by
                          #12

                          Check this out: http://codeguru.earthweb.com/buttonctrl/ccaptionbutton.html http://codeguru.earthweb.com/dialog/custom\_dialog\_caption.shtml and... http://codeguru.earthweb.com/misc/wm\_nclbuttonup.html Good luck!

                          1 Reply Last reply
                          0
                          • A Atlantys

                            That's what I was initially thinking, but that doesn't allow me to make the "rolled up" window have a different template. It'll just make the current window smaller, eh? If you'll notice what they do in Winamp (sorry, only program I know that has this feature), when it is rolled up, the title bar changes and buttons are added. Which is what i'm going for. The idea behind this is: the user can make the window as small as necessary without sacrificing the ability to use the more important functions (and Minimize makes the window disappear completely).

                            B Offline
                            B Offline
                            Baatezu
                            wrote on last edited by
                            #13

                            In winamp when the title bar is changing it is pulling bitmaps from either the default skin or from zip files containing the other skins (if you rename a skin file to .zip it will be unzippable). Same goes for the buttons and the rest of the graphics in winamp. I'm not sure what is done programatically to get them to draw over, but a few of the things mentioned looked like it could work. I had a little fun doing a skin for winamp once so I learned about how they change the image. :) I hope that helps some. Quinn

                            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