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. maximize/restore buttons

maximize/restore buttons

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiongraphics
3 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.
  • P Offline
    P Offline
    pmrainer
    wrote on last edited by
    #1

    Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer

    C T 2 Replies Last reply
    0
    • P pmrainer

      Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      There are a number of ways to do this. You can turn OFF the maximise button in the view window, you could capture WM_SIZE and when the window gets a message to size bigger than the bitmap you could make it size to just the bitmap, or you could just allow the maximising and centre the bitmap. Christian As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet. Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.

      1 Reply Last reply
      0
      • P pmrainer

        Hello! I have a great problem. I have done a view showing a bitmap. The view always fits the size of the bitmap. In the case, that the view is smaller than the bitmap, scrollbars are shown to scroll over the bitmap. Now I want to implement the maximize functionality that way, that pushing the maximize button expands the view to fit the bitmap only, but not to the size of the mainframe window. How can I implement this functionality. I already catched the corresponding messages in OnSysCommand and I can resize the view to fit the bitmap, but I can not change the maximize button to the restore button. Is anyone out there who can help? Many thanks in advance. Peter from Vienna pmrainer

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        Handle WM_GETMINMAXINFO. Use AdjustWindowRect[Ex] in the handler to compute frame size based on bitmap size. Tomasz Sowinski -- http://www.shooltz.com

        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