小弟在编程的过程中碰到这样一个难题,在单文档视图中,窗口分成左右两部分,左边嵌入一个form视图,右面是程序生成的框架,我现在的问题是,怎么通过点击左边form视图的一个按钮,右边框架显示一个对话框程序,此对话框是一个完整的可执行程序,要求此对话框程序很好的嵌在右边的框架内。我找了很多资料,不知道怎么搞定,往高手指点一二。
解决方案 »
- 关于GDI的一个小问题
- png图片加载到背景bmp上//为什么要把bmp与png拷贝到cdc里//然后拷贝OnEraseBkgnd(CDC* pDC)的pDC里才能显示透明效果?
- 给树状结构添加新一级父节点时怎么出现断言错误?求高手帮忙
- 能否在com中创建callback函数?
- xtreme toolkit 浮动面板问题请教?CDockPaneWnd的使用?
- 关于日期时间的探件使用问题!
- 求助:VC执行时一个连接错误(急,在 线等待)
- 求助 关于_outp函数
- 没有任何控件的对话框如何响应它的键盘按下事件呢?急啊。。。。。。。。。。
- undeclared identifier错误,help!!!
- "cannot add new member", 双击dialog上的button想添加函数时出现的。
- 控制台程序,支持MFC下的数据库问题
然后用MoveWindow吧
{
CMainFrame *mainf=(CMainFrame *)::AfxGetApp()->GetMainWnd();
CWnd *parent=mainf->m_split.GetPane(0,1);
//打程序
ShellExecute(NULL,"open","notepad.exe","","",SW_SHOW );
CWnd *temp=this->GetDesktopWindow()->GetWindow(HLD_CHILD);
CString txtcap;
while(temp)
{
temp->GetWindowText(txtcap);
if(txtcap="未定标题 - 记事本"))
{
temp->SetParent(parent);
break;
}
temp=temp->GetWindow(HLD_NEXT); }
}
这下面的是对了我试过:
void CFromView::OnButton2()
{
CMainFrame *mainf=(CMainFrame *)::AfxGetApp()->GetMainWnd();
CWnd *parent=mainf->m_split.GetPane(0,1);
//打程序
ShellExecute(NULL,"open","notepad.exe","","",SW_SHOW );
CWnd *temp=this->GetDesktopWindow()->GetWindow(GW_CHILD);
CString txtcap;
while(temp)
{
temp->GetWindowText(txtcap);
if(txtcap=="未定标题 - 记事本")
{
temp->SetParent(parent);
break;
}
temp=temp->GetWindow(GW_HWNDNEXT); }
}