
用 ::GetWindowRect( ), 第一个参数是目标猜悔颤窗口的HWND (注意前面有穗败两个冒号)
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所指定的位置迟烂
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)