bRet = IsWindowVisible( hWnd );
                    if ( bRet )
                    {
                        longStyle = GetWindowLong( hWnd, GWL_STYLE );
                        if ( ( longStyle & WS_CAPTION ) == WS_CAPTION )
                        {
                            longStyle = longStyle ^ WS_CAPTION;
                        }
                        SetWindowLong( hWnd, GWL_STYLE, longStyle );
                        ShowWindow( hWnd, SW_SHOWMAXIMIZED );
                        break;
                    }

解决方案 »

  1.   

    xiaoxiaohan(萧晓寒)的方法应该可以,但可能会闪一下。
    最好动态生成。
      

  2.   

    不好意思,查了一下msdn才记得:
    先create,然后改变风格,用xiaoxiaohan(萧晓寒)的方法或者直接用mfc的方法都可以。
    然后在ShowWindow(),就可以了。
      

  3.   


    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs cs.style = WS_POPUP;//WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE;
    cs.x = 0; cs.y = 0;
    cs.cx = GetSystemMetrics(SM_CXSCREEN); cs.cy  = GetSystemMetrics(SM_CYSCREEN);
    cs.hMenu = NULL; cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
    cs.lpszClass = AfxRegisterWndClass(0);
    return TRUE;这段代码实现全屏无标题栏无菜单的窗口。