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. Window Style

Window Style

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

    I Override The PreCreateWindow Func BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; cs.style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX|WS_MAXIMIZE; return TRUE; } And I want The Restore Button To Be Disabled i Removed The WS_MAXIMIZEBOX style but the resulting window covers the task bar and i don't want that. I just Like the size the window has when using the above settings combinations but don't want the window to be resized by cliking the restore or double clicking on the title bar Is There any way i can catch this using the WM_WINDOWPOSCHANGING,WM_NCCALCSIZE,WM_WINDOWPOSCHANGED or WM_SIZE

    K 1 Reply Last reply
    0
    • L Leyu

      I Override The PreCreateWindow Func BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; cs.style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX|WS_MAXIMIZE; return TRUE; } And I want The Restore Button To Be Disabled i Removed The WS_MAXIMIZEBOX style but the resulting window covers the task bar and i don't want that. I just Like the size the window has when using the above settings combinations but don't want the window to be resized by cliking the restore or double clicking on the title bar Is There any way i can catch this using the WM_WINDOWPOSCHANGING,WM_NCCALCSIZE,WM_WINDOWPOSCHANGED or WM_SIZE

      K Offline
      K Offline
      kriaz
      wrote on last edited by
      #2

      use following code: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseClass::OnCreate(lpCreateStruct) == -1) return -1; // Do something // Remove positions of menu CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //remove resizeing pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //remove Moveing pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //remove Maximizing } return 0; }

      L 1 Reply Last reply
      0
      • K kriaz

        use following code: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseClass::OnCreate(lpCreateStruct) == -1) return -1; // Do something // Remove positions of menu CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //remove resizeing pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //remove Moveing pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //remove Maximizing } return 0; }

        L Offline
        L Offline
        Leyu
        wrote on last edited by
        #3

        I Already Done That But When Double Cliking On The Title bar The Window Restores.

        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