如题,谢谢先 :)

解决方案 »

  1.   

    双击标题栏消息WM_NCLBUTTONDBLCLK,是在OnNcLButtonDblClk函数里处理的,在OnNcLButtonDblClk里就可以处理你想要实现的功能了,最大化可以用ShowWindow(SW_MAXIMIZE);居中显示CenterWindow()就可以了,要某个大小,你可以先movewindow(设好的大小),再CenterWindow();可是设个变量能判断是否是处于最大化。写个例子吧,可以参考一下,不一定行
    void CMonitorVideo::OnNcLButtonDblClk(UINT nHitTest, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    if(!m_bMax)
    {
                     ShowWindow(SW_MAXIMIZE);
    return; }
    else
    {
         CRect rc(0,0,400,500);
                 movewindow(&rc);
                 CenterWindow(this);  
                 return; }
    CDialog::OnNcLButtonDblClk(nHitTest, point);
    }
      

  2.   

    m_bMax为变量
    void CMy063Dlg::OnNcLButtonDblClk(UINT nHitTest, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    if(!m_bMax) 

    ShowWindow(SW_MAXIMIZE); 
    m_bMax=TRUE;
    return;
     


    else 
    {
    CRect rc=CRect(0,0,400,500);
    ShowWindow(SW_RESTORE);
       MoveWindow(&rc); 
        CenterWindow();
            m_bMax=false;
          

    }  CDialog::OnNcLButtonDblClk(nHitTest, point);
    }
      

  3.   

     响应OnSysCommand(UINT nID, LPARAM lParam)

              if(!m_bIsMaxWindow)
    {
    ShowWindow(SW_MAXIMIZE);
    m_bIsMaxWindow = TRUE;
    }
    else
    {
    ShowWindow(SW_SHOWNORMAL);
    m_bIsMaxWindow = FALSE;
    }
    CDialog::OnSysCommand(nID, lParam);
      

  4.   

    最大化消息可以直接向该窗口发送  SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); 
    最大化以后恢复最最大化前的状态   SendMessage(WM_SYSCOMMAND,SC_RESTORE ,0);