用CWnd类的ModifyStyle函数CWnd::ModifyStyle
BOOL ModifyStyle( DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0 );Return Value    Nonzero if style was successfully modified; otherwise, 0.ParametersdwRemove   
    Specifies window styles to be removed during style modification.dwAdd
    Specifies window styles to be added during style modification.nFlags
    Flags to be passed to SetWindowPos, or zero if SetWindowPos should not be called. The default is zero. See the Res section for a list of preset flags.或者用API中的SetWindowLongLONG SetWindowLong(
  HWND hWnd,       // handle of window
  int nIndex,      // offset of value to set
  LONG dwNewLong   // new value
);
 
具体用法你可以查MSDN

解决方案 »

  1.   

    ModifyStyle() 或 ModifyStyleEx()BOOL ModifyStyle(
       DWORD dwRemove,
       DWORD dwAdd,
       UINT nFlags = 0 
    );
    Parameters
    dwRemove 
    Specifies window styles to be removed during style modification. 
    dwAdd 
    Specifies window styles to be added during style modification. 
    nFlags 
    Flags to be passed to SetWindowPos, or zero if SetWindowPos should not be called. The default is zero. See the Res section for a list of preset flags. BOOL ModifyStyleEx(
       DWORD dwRemove,
       DWORD dwAdd,
       UINT nFlags = 0 
    );
    Parameters
    dwRemove 
    Specifies extended styles to be removed during style modification. 
    dwAdd 
    Specifies extended styles to be added during style modification. 
    nFlags 
    Flags to be passed to SetWindowPos, or zero if SetWindowPos should not be called. The default is zero. See the Res section for a list of preset flags. 
    Return Value
      

  2.   

    if (m_bMain)
    {
    ModifyStyle(WS_CAPTION,NULL,SWP_NOMOVE);
    m_bMain=FALSE;
    }
    else
    {
    ModifyStyle(NULL,WS_CAPTION,SWP_NOMOVE);
    m_bMain=TRUE;
    }
    我写了函数,但是title仍然有,只是无效,那位高手帮我看看代码,谢谢
      

  3.   

    直接修改string table里面的相关项的值不就ok了?
      

  4.   

    if (m_bMain)
    {
    ModifyStyle(WS_CAPTION,0,SWP_DRAWFRAME);
    m_bMain=FALSE;
    }
    else
    {
    ModifyStyle(0,WS_CAPTION,SWP_DRAWFRAME);
    m_bMain=TRUE;
    }
    搞定.