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. Disabling the minimize / Maximize button

Disabling the minimize / Maximize button

Scheduled Pinned Locked Moved C / C++ / MFC
2 Posts 2 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.
  • S Offline
    S Offline
    Sujan Christo
    wrote on last edited by
    #1

    Hi All, I am trying to disable the minimize & maximize button in a dialog based application. The close button get's disable, but the other two are not disabled. The code i am using is CMenu* pSM = GetSystemMenu(FALSE); if(pSM) { pSM->EnableMenuItem(SC_CLOSE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MINIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); } i am adding this code on OnInitDialog. Thanx in Advance Sujan

    D 1 Reply Last reply
    0
    • S Sujan Christo

      Hi All, I am trying to disable the minimize & maximize button in a dialog based application. The close button get's disable, but the other two are not disabled. The code i am using is CMenu* pSM = GetSystemMenu(FALSE); if(pSM) { pSM->EnableMenuItem(SC_CLOSE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MINIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); } i am adding this code on OnInitDialog. Thanx in Advance Sujan

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

      Can you not just remove the WS_MINIMIZEBOX and WS_MAXIMIZEBOX styles from the dialog template?


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      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