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. WM_NCPAINT minimize/restore

WM_NCPAINT minimize/restore

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

    Hi all, I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar. So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using

    pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
    pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);

    I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps) Thanks in advanced, ----------------- Genaro

    I 1 Reply Last reply
    0
    • P picazo

      Hi all, I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar. So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using

      pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
      pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);

      I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps) Thanks in advanced, ----------------- Genaro

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)? I modified dialog in this way, it should work for other windows.


      A nice tool for optimizing your Microsoft html-help contents. Includeh10

      P 1 Reply Last reply
      0
      • I includeh10

        Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)? I modified dialog in this way, it should work for other windows.


        A nice tool for optimizing your Microsoft html-help contents. Includeh10

        P Offline
        P Offline
        picazo
        wrote on last edited by
        #3

        I tried that, but perhaps I just used modifyStyle incorrectly. Can you please send me a code snippet of how you did it? Thanks, ----------------- Genaro

        I 1 Reply Last reply
        0
        • P picazo

          I tried that, but perhaps I just used modifyStyle incorrectly. Can you please send me a code snippet of how you did it? Thanks, ----------------- Genaro

          I Offline
          I Offline
          includeh10
          wrote on last edited by
          #4

          try UNIT uRemove=WS_MAXIMIZEBOX|WS_MINIMIZEBOX; //call pYourWnd->ModifyStyle(uRemove,0); //or call pYourWnd->ModifyStyle(uRemove,0,SWP_NOSIZE|SWP_NOMOVE);


          A nice tool for optimizing your Microsoft html-help contents. Includeh10

          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