in AliRTC2.5/Windows/MFC Demo/RtcSample/RTCSampleMainInterface.cpp [1792:1857]
void CRTCSampleMainInterface::MoveMonitorMarshalling(bool bMonitorState)
{
// 禁用移动
m_ctlButtonLeft.ShowWindow(FALSE);
m_ctlButtonRight.ShowWindow(FALSE);
m_ctlVideo1.ShowWindow(FALSE);
m_ctlVideo2.ShowWindow(FALSE);
m_ctlVideo3.ShowWindow(FALSE);
m_ctlVideo4.ShowWindow(FALSE);
m_ctlVideo5.ShowWindow(FALSE);
m_ctlRoom1.ShowWindow(FALSE);
m_ctlRoom2.ShowWindow(FALSE);
m_ctlRoom3.ShowWindow(FALSE);
m_ctlRoom4.ShowWindow(FALSE);
m_ctlRoom5.ShowWindow(FALSE);
CRect rcButton;
m_ctlButtonLeft.GetWindowRect(&rcButton);
CRect rcRtcOnline;
m_ctlRtconline.GetWindowRect(&rcRtcOnline);
int iButtonWidth = 0;
if (true == bMonitorState)
{
m_ctlButtonLeft.SetWindowPos(NULL, 12, rcRtcOnline.Height() / 2 + 10 - rcButton.Height() / 2, 20, rcButton.Height(), SWP_NOZORDER);
m_ctlButtonRight.SetWindowPos(NULL, rcRtcOnline.Width() - rcButton.Width() + 8, rcRtcOnline.Height() / 2 + 10 - rcButton.Height() / 2, 20, rcButton.Height(), SWP_NOZORDER);
iButtonWidth = 20;
}
else
{
m_ctlButtonLeft.SetWindowPos(NULL, 12, rcRtcOnline.Height() / 2 + 10 - rcButton.Height() / 2, 25, rcButton.Height(), SWP_NOZORDER);
m_ctlButtonRight.SetWindowPos(NULL, rcRtcOnline.Width() - rcButton.Width() + 8, rcRtcOnline.Height() / 2 + 10 - rcButton.Height() / 2, 25, rcButton.Height(), SWP_NOZORDER);
iButtonWidth = 25;
}
int iVideoWidth = (rcRtcOnline.Width() - 20 - iButtonWidth * 2) / 5;
int iVideoHeight = rcRtcOnline.Height() * 0.9;
int iRoomWidth = (rcRtcOnline.Width() - 20 - iButtonWidth * 2) / 5;
int iRoomHeight = rcRtcOnline.Height() * 0.8;
GetDlgItem(m_vecThrowingScreenInfo[0].s_iReflectTips)->SetWindowPos(NULL, 14 + iButtonWidth, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10, iVideoWidth, iVideoHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[0].s_iReflectID)->SetWindowPos(NULL, 14 + iButtonWidth, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10 + iVideoHeight - iRoomHeight, iRoomWidth, iRoomHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[1].s_iReflectTips)->SetWindowPos(NULL, 17 + iButtonWidth + iVideoWidth, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10, iVideoWidth, iVideoHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[1].s_iReflectID)->SetWindowPos(NULL, 17 + iButtonWidth + iVideoWidth, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10 + iVideoHeight - iRoomHeight, iRoomWidth, iRoomHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[2].s_iReflectTips)->SetWindowPos(NULL, 20 + iButtonWidth + iVideoWidth * 2, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10, iVideoWidth, iVideoHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[2].s_iReflectID)->SetWindowPos(NULL, 20 + iButtonWidth + iVideoWidth * 2, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10 + iVideoHeight - iRoomHeight, iRoomWidth, iRoomHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[3].s_iReflectTips)->SetWindowPos(NULL, 23 + iButtonWidth + iVideoWidth * 3, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10, iVideoWidth, iVideoHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[3].s_iReflectID)->SetWindowPos(NULL, 23 + iButtonWidth + iVideoWidth * 3, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10 + iVideoHeight - iRoomHeight, iRoomWidth, iRoomHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[4].s_iReflectTips)->SetWindowPos(NULL, 26 + iButtonWidth + iVideoWidth * 4, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10, iVideoWidth, iVideoHeight, SWP_NOZORDER);
GetDlgItem(m_vecThrowingScreenInfo[4].s_iReflectID)->SetWindowPos(NULL, 26 + iButtonWidth + iVideoWidth * 4, (rcRtcOnline.Height() - iVideoHeight) / 2 + 10 + iVideoHeight - iRoomHeight, iRoomWidth, iRoomHeight, SWP_NOZORDER);
// 启用重绘
m_ctlButtonLeft.ShowWindow(TRUE);
m_ctlButtonRight.ShowWindow(TRUE);
m_ctlVideo1.ShowWindow(TRUE);
m_ctlVideo2.ShowWindow(TRUE);
m_ctlVideo3.ShowWindow(TRUE);
m_ctlVideo4.ShowWindow(TRUE);
m_ctlVideo5.ShowWindow(TRUE);
m_ctlRoom1.ShowWindow(TRUE);
m_ctlRoom2.ShowWindow(TRUE);
m_ctlRoom3.ShowWindow(TRUE);
m_ctlRoom4.ShowWindow(TRUE);
m_ctlRoom5.ShowWindow(TRUE);
}