in AliRTC2.5/Windows/MFC Demo/RtcSample/RTCSampleMainInterface.cpp [1612:1703]
void CRTCSampleMainInterface::MoveConsoleCfg(int nWinWidth, int nWinHeight)
{
// 禁用移动
m_ctlSetting.ShowWindow(FALSE);
m_ctlFlow.ShowWindow(FALSE);
m_ctlCheckVideo.ShowWindow(FALSE);
m_ctlCheckScreenShare.ShowWindow(FALSE);
m_ctlCheckAudio.ShowWindow(FALSE);
//m_ctlMirror.ShowWindow(FALSE);
//m_ctlCheckCameraMirror.ShowWindow(FALSE);
//m_ctlCheckScreenMirror.ShowWindow(FALSE);
m_ctlQuality.ShowWindow(FALSE);
GetDlgItem(IDC_RADIO_CLEAR)->ShowWindow(FALSE);
GetDlgItem(IDC_RADIO_FLUENT)->ShowWindow(FALSE);
m_ctlScene.ShowWindow(FALSE);
GetDlgItem(IDC_RADIO_CAMERA)->ShowWindow(FALSE);
GetDlgItem(IDC_RADIO_SHARE)->ShowWindow(FALSE);
m_ctlButton.ShowWindow(FALSE);
m_ctlButton_OnekeyNovide.ShowWindow(FALSE);
m_ctlButton_ExitRoom.ShowWindow(FALSE);
// 控制台配置主窗口
CRect rcCfg;
m_ctlSetting.GetWindowRect(&rcCfg);
// 按钮
CRect rcButton;
m_ctlButton.GetWindowRect(&rcButton);
CRect rcButton_OnekeyNovide;
m_ctlButton_OnekeyNovide.GetWindowRect(&rcButton_OnekeyNovide);
CRect rcButton_ExitRoom;
m_ctlButton_ExitRoom.GetWindowRect(&rcButton_ExitRoom);
//
CRect rcCheckScreenShare;
m_ctlCheckScreenShare.GetWindowRect(&rcCheckScreenShare);
//
CRect rcCheckScreenMirror;
m_ctlCheckScreenMirror.GetWindowRect(&rcCheckScreenMirror);
//
CRect rcCheckClear;
GetDlgItem(IDC_RADIO_FLUENT)->GetWindowRect(&rcCheckClear);
//
CRect rcCheckShare;
GetDlgItem(IDC_RADIO_SHARE)->GetWindowRect(&rcCheckShare);
// 移动
int iFlowGroupWidth = rcCfg.Width() - 30;
int iFlowGGroupHeight = (rcCfg.Height() - 30) / 3.5 - 5;
int iOtherGroupWidth = rcCfg.Width() - 30;
int iOtherGroupHeight = (rcCfg.Height() - 30 - iFlowGGroupHeight) / 3 - 5;
// 控制台配置主窗口
m_ctlSetting.SetWindowPos(NULL, nWinWidth - rcCfg.Width() - 10, nWinHeight - rcCfg.Height() - rcButton.Height() - 15, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 音视频流窗口
m_ctlFlow.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 5, nWinHeight - rcCfg.Height() - rcButton.Height() + 5, iFlowGroupWidth, iFlowGGroupHeight, SWP_NOZORDER);
m_ctlCheckVideo.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 20, nWinHeight - rcCfg.Height() - rcButton.Height() + 20, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
m_ctlCheckScreenShare.SetWindowPos(NULL, nWinWidth - 35 - rcCheckScreenShare.Width(), nWinHeight - rcCfg.Height() - rcButton.Height() + 20, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
m_ctlCheckAudio.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 20, nWinHeight - rcCfg.Height() - rcButton.Height() + 23 + rcCheckScreenShare.Height(), 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 镜像窗口
m_ctlMirror.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 5, nWinHeight - rcCfg.Height() - rcButton.Height() + iFlowGGroupHeight + 8, iOtherGroupWidth, iOtherGroupHeight, SWP_NOZORDER);
m_ctlCheckCameraMirror.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 20, nWinHeight - rcCfg.Height() - rcButton.Height() + iFlowGGroupHeight + 25, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
m_ctlCheckScreenMirror.SetWindowPos(NULL, nWinWidth - 35 - rcCheckScreenMirror.Width(), nWinHeight - rcCfg.Height() - rcButton.Height() + iFlowGGroupHeight + 25, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 视频质量窗口
m_ctlQuality.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 5, nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight + iFlowGGroupHeight + 11, iOtherGroupWidth, iOtherGroupHeight, SWP_NOZORDER);
GetDlgItem(IDC_RADIO_CLEAR)->SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 20, nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight + iFlowGGroupHeight + 28, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
GetDlgItem(IDC_RADIO_FLUENT)->SetWindowPos(NULL, nWinWidth - 35 - rcCheckClear.Width(), nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight + iFlowGGroupHeight + 28, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 控制台场景窗口
m_ctlScene.SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 5, nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight * 2 + iFlowGGroupHeight + 14, iOtherGroupWidth, iOtherGroupHeight, SWP_NOZORDER);
GetDlgItem(IDC_RADIO_CAMERA)->SetWindowPos(NULL, nWinWidth - rcCfg.Width() + 20, nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight * 2 + iFlowGGroupHeight + 31, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
GetDlgItem(IDC_RADIO_SHARE)->SetWindowPos(NULL, nWinWidth - 35 - rcCheckShare.Width(), nWinHeight - rcCfg.Height() - rcButton.Height() + iOtherGroupHeight * 2 + iFlowGGroupHeight + 31, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 按钮
m_ctlButton.SetWindowPos(NULL, nWinWidth - rcCfg.Width() - 10, nWinHeight - rcButton.Height() - 10, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
m_ctlButton_OnekeyNovide.SetWindowPos(NULL, nWinWidth - rcCfg.Width() - 10 + rcButton.Width() + 2, nWinHeight - rcButton_OnekeyNovide.Height() - 10, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
m_ctlButton_ExitRoom.SetWindowPos(NULL, nWinWidth - rcCfg.Width() - 10 + rcButton.Width() + rcButton_OnekeyNovide.Width() + 2, nWinHeight - rcButton_ExitRoom.Height() - 10, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
// 启用重绘
m_ctlSetting.ShowWindow(TRUE);
//m_ctlFlow.ShowWindow(TRUE);
//m_ctlCheckVideo.ShowWindow(TRUE);
//m_ctlCheckScreenShare.ShowWindow(TRUE);
//m_ctlCheckAudio.ShowWindow(TRUE);
//m_ctlMirror.ShowWindow(TRUE);
//m_ctlCheckCameraMirror.ShowWindow(TRUE);
//m_ctlCheckScreenMirror.ShowWindow(TRUE);
m_ctlQuality.ShowWindow(TRUE);
GetDlgItem(IDC_RADIO_CLEAR)->ShowWindow(TRUE);
GetDlgItem(IDC_RADIO_FLUENT)->ShowWindow(TRUE);
//m_ctlScene.ShowWindow(TRUE);
//GetDlgItem(IDC_RADIO_CAMERA)->ShowWindow(TRUE);
//GetDlgItem(IDC_RADIO_SHARE)->ShowWindow(TRUE);
//m_ctlButton.ShowWindow(TRUE);
//m_ctlButton_OnekeyNovide.ShowWindow(TRUE);
m_ctlButton_ExitRoom.ShowWindow(TRUE);
}