void CFormViewEx::OnInitialUpdate() 
{
         pDlgUserList = new CScreenDlgEx(this);
pDlgUserList->Create(IDD_DLG_SCREEN,this);

pDlgUserList->ShowWindow(SW_SHOW);
}void CFormViewEx::OnSize(UINT nType, int cx, int cy) 
{
      做一个判断 然后调用 但是确实是有执行 但是就是不动
    if(pDlgUserList->GetSafeHwnd())
{ pDlgUserList->SetWindowPos(this,m_moverect.Width()*0.16,m_moverect.Height()*0.5,m_moverect.Width()*0.7,m_moverect.Height()*0.64,SWP_SHOWWINDOW);}}或者是 pDlgUserList->MoveWindow(。。)
 我在OnSize中调用的 以上任意一个函数 
但是他都是移动不懂 都不动弹 一直在顶部窗口
求大牛有啥好办法

解决方案 »

  1.   

    如果设置了SWP_SHOWWINDOW和SWP_HIDEWINDOW标志,则窗口不能被移动和改变大小。
    换成SWP_NOACTIVATE试试。
      

  2.   

    void CFormViewEx::CreateWordEx()
    {
    CRect m_tPlayRect;
       CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
    CChildFrame* pChildFrame = (CChildFrame*)pMainFrame->GetActiveFrame(); m_PpsPlayer.GetWindowRect(m_tPlayRect);
       this->ScreenToClient(m_tPlayRect);
    CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,LoadCursor (NULL, IDC_ARROW),(HBRUSH) GetStockObject (WHITE_BRUSH),NULL);
    g_wnd.CreateEx(0,className,"OpenGL",
       WS_CHILD 
    | WS_VISIBLE
    | WS_CLIPSIBLINGS
    | WS_CLIPCHILDREN
    |WS_POPUPWINDOW,
    CRect(m_tPlayRect.left*1.6,m_tPlayRect.Height()*0.9,m_tPlayRect.Width()*2,m_tPlayRect.Height()),&m_PpsPlayer,0); //|WS_POPUPWINDOWCRect(300,380,1150,540)
    }
    我没设置 啥标志 这个也无法移动
      

  3.   

    在这个类的CScreenDlgEx::onsize中做些操作void CScreenDlgEx::OnSize(UINT nType, int cx, int cy) 
    {
    CDialog::OnSize(nType, cx, cy);

    // TODO: Add your message handler code here
    CRect rectClient;
    CRect rectBottom;
    CRect rectAgentInfo;
    int nHeightBottom = 36;
    int nHeightAgentInfo = 65;

    this->GetClientRect(rectClient);
    rectClient.InflateRect(1, 1); // 增加矩形高度1,宽度1

    rectClient.top=rectClient.top+15;
    rectClient.bottom=rectClient.bottom - nHeightBottom - nHeightAgentInfo;

    rectAgentInfo = rectClient;
    rectAgentInfo.top = rectClient.bottom;
    rectAgentInfo.bottom = rectAgentInfo.top + nHeightAgentInfo;

    rectBottom = rectAgentInfo;
    rectBottom.top = rectAgentInfo.bottom;
    rectBottom.bottom = rectBottom.top + nHeightBottom;

    m_rectButtom = rectBottom;

    if(m_tree.m_hWnd)
    {
    m_tree.MoveWindow(rectClient); 
    m_cInfo.MoveWindow(rectAgentInfo);
    m_mymap.MoveWindow(rectBottom);
    }
    }