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中调用的 以上任意一个函数
但是他都是移动不懂 都不动弹 一直在顶部窗口
求大牛有啥好办法
换成SWP_NOACTIVATE试试。
{
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)
}
我没设置 啥标志 这个也无法移动
{
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);
}
}