rt

解决方案 »

  1.   

    in CMainFrame::OnCreate:         ModifyStyle(WS_THICKFRAME,0);
    if (!m_wndStatusBar.Create(this) ||
    !m_wndStatusBar.SetIndicators(indicators,
      sizeof(indicators)/sizeof(UINT)))
    {
    TRACE0("Failed to create status bar\n");
    return -1;      // fail to create
    }
    ModifyStyle(0,WS_THICKFRAME);
    CMenu* psysmenu=GetSystemMenu(FALSE);
    psysmenu->RemoveMenu(SC_SIZE,MF_BYCOMMAND);
      

  2.   

    void CNoMoveDlg::OnNcLButtonDown(UINT nHitTest, CPoint point) 
      {
      // TODO: Add your message handler code here and/or call default return;
    CDialog::OnNcLButtonDown(nHitTest, point);
      }
      这样就行了, 不过,你点击标题栏,它可是甩都不甩你喔!
      

  3.   

    还有就是可以通过限制鼠标的范围
    把它固定在该窗体的内部
    GetWindowRect(&m_rect);
    ::ClipCursor (&m_rect);
      

  4.   

    我不要去掉标题栏
    限制鼠标不行,我不只操作一个窗口
    void CNoMoveDlg::OnNcLButtonDown(UINT nHitTest, CPoint point),我的窗口是一个视,我加了这个消息响应函数以后,好像我拖动标题栏时,根本就没响应这个函数,不管用
      

  5.   

    屏蔽SC_MOVE消息,当HANDLE是该窗口时
      

  6.   

    用SetWindowPos()函数,nFlags选择SWP_NOMOVE即可.
      

  7.   

    下面是我以前写过的程序,鼠标就不能移动我的这个窗体,只处理自己希望处理的地方,其他的地方不管,连默认的处理都不调用
    void CVolcanoProtector_1Dlg::OnNcLButtonDown(UINT nHitTest, CPoint point) 
    {
    //检测各按钮是否按到
    if (m_rtIcon.PtInRect(point) || m_rtButtHelp.PtInRect(point))
    {
       CAboutDlg dlgAbout;
           dlgAbout.DoModal();
    }
    else if (m_rtButtExit.PtInRect(point))
    SendMessage(WM_CLOSE);
    else if (m_rtButtMin.PtInRect(point))
    SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, MAKELPARAM(point.x, point.y));

    }