Skip to content

Commit 7d5e128

Browse files
committed
MS-26514 MS-26529
1 parent ea7604d commit 7d5e128

4 files changed

Lines changed: 26 additions & 7 deletions

File tree

windows/APIExample/APIExample/Advanced/AudioEffect/CAgoraEffectDlg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ void CAgoraEffectDlg::DoDataExchange(CDataExchange* pDX)
5555

5656

5757
BEGIN_MESSAGE_MAP(CAgoraEffectDlg, CDialogEx)
58+
ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraEffectDlg::OnEIDLeaveChannel)
59+
ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraEffectDlg::OnEIDJoinChannelSuccess)
5860
ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CAgoraEffectDlg::OnBnClickedButtonJoinchannel)
5961
ON_BN_CLICKED(IDC_BUTTON_ADD_EFFECT, &CAgoraEffectDlg::OnBnClickedButtonAddEffect)
6062
ON_BN_CLICKED(IDC_BUTTON_PRELOAD, &CAgoraEffectDlg::OnBnClickedButtonPreload)
@@ -504,13 +506,10 @@ BOOL CAgoraEffectDlg::PreTranslateMessage(MSG* pMsg)
504506
return CDialogEx::PreTranslateMessage(pMsg);
505507
}
506508

507-
508-
509-
510-
511509
//EID_JOINCHANNEL_SUCCESS message window handler
512510
LRESULT CAgoraEffectDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam)
513511
{
512+
m_btnJoinChannel.EnableWindow(TRUE);
514513
m_joinChannel = true;
515514
m_btnJoinChannel.SetWindowText(commonCtrlLeaveChannel);
516515
m_btnJoinChannel.EnableWindow(TRUE);
@@ -526,6 +525,7 @@ LRESULT CAgoraEffectDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam)
526525
//EID_LEAVEHANNEL_SUCCESS message window handler
527526
LRESULT CAgoraEffectDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam)
528527
{
528+
m_btnJoinChannel.EnableWindow(TRUE);
529529
m_joinChannel = false;
530530
m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel);
531531
CString strInfo;

windows/APIExample/APIExample/Advanced/CustomVideoCapture/CAgoraCaptureVideoDlg.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ bool CAgoraCaptureVideoDlg::InitAgora()
7070
*/
7171
void CAgoraCaptureVideoDlg::UnInitAgora()
7272
{
73+
m_cmbVideoDevice.EnableWindow(TRUE);
74+
m_cmbVideoType.EnableWindow(TRUE);
75+
m_btnSetExtCapture.EnableWindow(TRUE);
7376
if (m_rtcEngine) {
7477
if (m_joinChannel)
7578
m_joinChannel = !m_rtcEngine->leaveChannel();
@@ -371,6 +374,9 @@ void CAgoraCaptureVideoDlg::OnClickedButtonJoinchannel()
371374
//EID_JOINCHANNEL_SUCCESS message window handler.
372375
LRESULT CAgoraCaptureVideoDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam)
373376
{
377+
m_cmbVideoDevice.EnableWindow(FALSE);
378+
m_cmbVideoType.EnableWindow(FALSE);
379+
m_btnSetExtCapture.EnableWindow(FALSE);
374380
m_joinChannel = true;
375381
m_btnJoinChannel.EnableWindow(TRUE);
376382
m_btnJoinChannel.SetWindowText(commonCtrlLeaveChannel);
@@ -388,7 +394,9 @@ LRESULT CAgoraCaptureVideoDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lPa
388394
//EID_LEAVE_CHANNEL message window handler.
389395
LRESULT CAgoraCaptureVideoDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam)
390396
{
391-
397+
m_cmbVideoDevice.EnableWindow(TRUE);
398+
m_cmbVideoType.EnableWindow(TRUE);
399+
m_btnSetExtCapture.EnableWindow(TRUE);
392400
m_joinChannel = false;
393401
m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel);
394402

windows/APIExample/APIExample/Advanced/MediaIOCustomVideoCaptrue/CAgoraMediaIOVideoCaptureDlg.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ bool CAgoraMediaIOVideoCaptureDlg::InitAgora()
6969
*/
7070
void CAgoraMediaIOVideoCaptureDlg::UnInitAgora()
7171
{
72+
m_cmbVideoDevice.EnableWindow(TRUE);
73+
m_cmbVideoType.EnableWindow(TRUE);
74+
m_btnSetExtCapture.EnableWindow(TRUE);
7275
if (m_rtcEngine) {
7376
if (m_joinChannel)
7477
m_joinChannel = !m_rtcEngine->leaveChannel();
@@ -323,6 +326,9 @@ void CAgoraMediaIOVideoCaptureDlg::OnClickedButtonJoinchannel()
323326
//EID_JOINCHANNEL_SUCCESS message window handler.
324327
LRESULT CAgoraMediaIOVideoCaptureDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam)
325328
{
329+
m_cmbVideoDevice.EnableWindow(FALSE);
330+
m_cmbVideoType.EnableWindow(FALSE);
331+
m_btnSetExtCapture.EnableWindow(FALSE);
326332
m_joinChannel = true;
327333
m_btnJoinChannel.EnableWindow(TRUE);
328334
m_btnJoinChannel.SetWindowText(commonCtrlLeaveChannel);
@@ -340,7 +346,9 @@ LRESULT CAgoraMediaIOVideoCaptureDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPA
340346
//EID_LEAVE_CHANNEL message window handler.
341347
LRESULT CAgoraMediaIOVideoCaptureDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam)
342348
{
343-
349+
m_cmbVideoDevice.EnableWindow(TRUE);
350+
m_cmbVideoType.EnableWindow(TRUE);
351+
m_btnSetExtCapture.EnableWindow(TRUE);
344352
m_joinChannel = false;
345353
m_btnJoinChannel.SetWindowText(commonCtrlJoinChannel);
346354

windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,10 @@ void CAgoraScreenCapture::OnBnClickedButtonStartShareScreen()
864864

865865
m_monitors.GetScreenRect();
866866
ScreenCaptureParameters capParam;
867-
867+
if (regionRect.x < 0 || regionRect.y < 0) {
868+
AfxMessageBox(_T("select hwnd rect has minus location"));
869+
return;
870+
}
868871
m_rtcEngine->startScreenCaptureByScreenRect(screenRegion, regionRect, capParam);
869872
m_btnShareScreen.SetWindowText(screenShareCtrlStopShare);
870873

0 commit comments

Comments
 (0)