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. Disable Restoredown button

Disable Restoredown button

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
5 Posts 5 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.
  • K Offline
    K Offline
    Kiran Pinjala
    wrote on last edited by
    #1

    I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().

    m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
    m_pMainWnd->UpdateWindow();

    With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then. I want the window to be maximised or minised, but not to be resotred down. How to do that. Thank you

    Saadhinchaali

    S C S J 4 Replies Last reply
    0
    • K Kiran Pinjala

      I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().

      m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
      m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
      m_pMainWnd->UpdateWindow();

      With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then. I want the window to be maximised or minised, but not to be resotred down. How to do that. Thank you

      Saadhinchaali

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      You're probably better off handling WM_GETMINMAXINFO, and telling Windows what you want the minimum and maximum size of your window to be (hint: same size as the screen!).

      1 Reply Last reply
      0
      • K Kiran Pinjala

        I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().

        m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
        m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
        m_pMainWnd->UpdateWindow();

        With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then. I want the window to be maximised or minised, but not to be resotred down. How to do that. Thank you

        Saadhinchaali

        C Offline
        C Offline
        Code o mat
        wrote on last edited by
        #3

        Try handling the WM_SYSCOMMAND messages (OnSysCommand) and swalow the restore (SC_RESTORE) message. Don't know how reliable that is though...

        > The problem with computers is that they do what you tell them to do and not what you want them to do. <

        1 Reply Last reply
        0
        • K Kiran Pinjala

          I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().

          m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
          m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
          m_pMainWnd->UpdateWindow();

          With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then. I want the window to be maximised or minised, but not to be resotred down. How to do that. Thank you

          Saadhinchaali

          S Offline
          S Offline
          SandipG
          wrote on last edited by
          #4

          You can handle WM_NCLBUTTONDBCLICK[^] message.

          Regards, Sandip.

          1 Reply Last reply
          0
          • K Kiran Pinjala

            I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().

            m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
            m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
            m_pMainWnd->UpdateWindow();

            With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then. I want the window to be maximised or minised, but not to be resotred down. How to do that. Thank you

            Saadhinchaali

            J Offline
            J Offline
            Jijo Raj
            wrote on last edited by
            #5

            Check out this[^]and this[^]. Those links will be helpful. Regards, Jijo.

            _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

            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