
MFC 中 获取窗口的位置 隐藏原窗口后在该位置上输出一个新的窗口用到哪些函数?
如题我要获取一个窗口的位置,隐藏原来的窗口后,然后让一个新的窗口在该位置输出,要用到哪些函数?...
如题 我要获取一个窗口的位置 ,隐藏原来的窗口后,然后让一个新的窗口在该位置输出, 要用到哪些函数?
展开
2个回答
2013-07-13
展开全部
void CMainFrame::OnViewNewtool()
{
// TOD Add your command handler code here
GetWindowRect( &m_toolRect ) ;//m_toolRect是用来存贮工具栏浮动时的位置的,是个类成员变量
if ( m_newToolBar.IsFloating() )
{
m_newToolBar.GetWindowRect( &m_toolRect ) ;//获取工具栏位置,并存贮在m_toolRect中
}
else
{
m_toolRect = CRect( 0,0,0,0 ) ;
}
if ( m_newToolBar.IsWindowVisible() )
{
m_newToolBar.ShowWindow( SW_HIDE ) ;
}
else
{
m_newToolBar.ShowWindow( SW_SHOW ) ;
}
RecalcLayout() ;
DockControlBar( &m_newToolBar ) ;
if ( !m_toolRect.IsRectEmpty() /*&& m_newToolBar.IsWindowVisible()*/ )
{
FloatControlBar( &m_newToolBar,CPoint( m_toolRect.left,m_toolRect.top ) ) ;//使工具栏浮动到CPoint所指定的位置
}
}
{
// TOD Add your command handler code here
GetWindowRect( &m_toolRect ) ;//m_toolRect是用来存贮工具栏浮动时的位置的,是个类成员变量
if ( m_newToolBar.IsFloating() )
{
m_newToolBar.GetWindowRect( &m_toolRect ) ;//获取工具栏位置,并存贮在m_toolRect中
}
else
{
m_toolRect = CRect( 0,0,0,0 ) ;
}
if ( m_newToolBar.IsWindowVisible() )
{
m_newToolBar.ShowWindow( SW_HIDE ) ;
}
else
{
m_newToolBar.ShowWindow( SW_SHOW ) ;
}
RecalcLayout() ;
DockControlBar( &m_newToolBar ) ;
if ( !m_toolRect.IsRectEmpty() /*&& m_newToolBar.IsWindowVisible()*/ )
{
FloatControlBar( &m_newToolBar,CPoint( m_toolRect.left,m_toolRect.top ) ) ;//使工具栏浮动到CPoint所指定的位置
}
}
2013-07-13
展开全部
获取位置GetWindowPos
显示窗口ShowWindow
显示窗口ShowWindow
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询