我在设计窗口的时候,忘了考虑其最大化和最小化问题,
   1。假如:我现在的窗口有最大化和最小化,但是我要使它,只有最小化,不能最大化怎么办?
  2。要是开始只有关闭,我要添加最小化怎么做。?

解决方案 »

  1.   

    The SetWindowLong function changes an attribute of the specified window. The function also sets the 32-bit (long) value at the specified offset into the extra window memory.LONG SetWindowLong(          HWND hWnd,
        int nIndex,
        LONG dwNewLong
    );The SetWindowLongPtr function changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory.LONG_PTR SetWindowLongPtr(          HWND hWnd,
        int nIndex,
        LONG_PTR dwNewLong
    );
      

  2.   

    CWnd * pWnd = AfxGetMainWnd();
    pWnd->ModifyStyle(WS_MAXIMIZEBOX|WS_MINIMIZEBOX,NULL,SWP_DRAWFRAME);
    ==================
    关闭最大最小近钮
      

  3.   

    pWnd->ModifyStyle(NULL,WS_MAXIMIZEBOX|WS_MINIMIZEBOX,SWP_DRAWFRAME);
    是增加
      

  4.   

    用就没有最大化,只有最小化了同理,如果不要一项,用~即可CWnd * pWnd = AfxGetMainWnd();
    pWnd->ModifyStyle(~WS_MAXIMIZEBOX && WS_MINIMIZEBOX,NULL,SWP_DRAWFRAME);