Help Center/ Meeting/ Client SDK Reference/ Windows SDK/ Typical Scenarios/ Scenario 10: Customizing the Invite Button in a Meeting
Updated on 2024-07-30 GMT+08:00

Scenario 10: Customizing the Invite Button in a Meeting

Description

In most scenarios where the SDK is used for secondary development, third-party applications do not use the corporate directory provided by Huawei Cloud Meeting. Therefore, the page for inviting participants only provides a button and does not provide the complete function of inviting participants. You must implement the function by yourself.

Service Process

When using the SDK to implement the participant invitation function, call the Config API, implement the OnConfigResult function, and then implement the OnClickInjectBtn function after the Invite button is clicked in the meeting.

  1. Call the API.

    After the SDK is initialized, call the Config API to customize the Invite button.

  2. Implement the callback function.

    Implement the OnConfigResult function.

  3. Implement the notification function.

    After the Invite button is clicked, implement the OnClickInjectBtn function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* Configure the Invite button.
*/
int hwmSDKConfigUI::hwmSDKStartUIConfig()
{
    // Configure the Invite button.
    CString inviteBtn = ("{\"frame\":{\"confMenu\" : {\"toolBar\":{\"button\":[{\"id\":\"invite\",\"showAsAction\" : \"ifRoom\",\"isCustomizedClick\" : true}]}}}}");
    string uiConfig CTools::UNICODE2UTF(inviteBtn);
    ret = hwmsdkagent::Config(uiConfig);
    return ret;
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/**
* Configure the callback function.
*/
void demoCallbackProc::OnConfigResult(hwmsdk::HwmErrCode ret, const char* msg)
{
    CString codeStr;
    codeStr.Format(_T("%d"), ret);
    string msgStr = CTools::UTF82MultiByte(msg);
    CString tips = _T("OnConfigResult code:") + codeStr + _T(", msg:") + CString(msgStr.c_str());
    AfxMessageBox(tips);
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/**
* Message notification upon button clicking
*/
void notifyProc::OnClickInjectBtn(hwmsdkagent::HwmClickInjectBtn injectBtn, void* data, const char* id)
 {
     INT_PTR nRes;
     switch (injectBtn)
         // Send a notification after the Invite button is clicked.
         case hwmsdkagent::HWM_CLICK_INJECT_BTN_INVITE:
        {
            // Display the page for inviting participants with a corporate directory.
            hwm_ui_demo_inviteDlg inviteDlg;
            nRes = inviteDlg.DoModal();
            break;
        }
 }