VC++ Embed Dialog

private: CDlgTest m_embededDlg;

 

m_embededDlg.Create(CDlgTest::IDD,this); HWND hwnd=m_embededDlg.GetSafeHwnd(); long style=::GetWindowLong(hwnd,GWL_STYLE); style|=WS_CHILD; style&=~WS_CAPTION; ::SetWindowLong(hwnd,GWL_STYLE,style); CRect rect; GetDlgItem(IDC_STATIC)->GetWindowRect(&rect); CPoint pt; pt=rect.TopLeft(); ScreenToClient(&pt); ::SetWindowPos(m_embededDlg.m_hWnd,NULL,pt.x,pt.y,rect.Width(),rect.Height(),SWP_SHOWWINDOW|SWP_NOZORDER);

你可能感兴趣的:(VC++ Embed Dialog)