15,979
社区成员
发帖
与我相关
我的任务
分享
if(GoNotePad("",FALSE))
{//
Sleep(100);// let NotePad show window
m_hwnd=::FindWindow("NotePad","无标题 - 记事本");
if(m_hwnd)
{
LONG style=GetWindowLong(m_hwnd,GWL_STYLE);// 14CF 0000
// 1=WS_VISIBLE 4=WS_CLIPSIBLINGS C=WS_CAPTION;WS_THICKFRAME=4+WS_SYSMENU=8+WS_GROUP=2+WS_TABSTOP=1==F
style &=~WS_CAPTION;
style &=~WS_THICKFRAME;
style |=WS_CHILD;
SetWindowLong(m_hwnd,GWL_STYLE,style);
CRect rc;
GetClientRect(rc);
rc.bottom-=60;
// ClientToScreen(&rc);
// afxDump << rc << "OK\n";
::SetParent(m_hwnd,this->m_hWnd);
::SetWindowPos(m_hwnd,HWND_TOP, rc.left, rc.top, rc.Width(), rc.Height(),SWP_FRAMECHANGED);
// ::BringWindowToTop(m_hwnd);
}
}
注意 风格:
style &=~WS_CAPTION;// 没有 标题栏 , 原 sysmenu 要 放 主窗口
style &=~WS_THICKFRAME;// 不许 调整, 通过 主窗口 来调整。
style |=WS_CHILD;// 作为 子窗口