Updated on 2023-03-23 GMT+08:00

Setting a Sharing Policy

SetShareStrategy

API Description

This API is called to set a screen sharing policy to clarity preferred or fluency preferred.

Precautions

This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.

Method Definition

HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetShareStrategy(HwmShareStrategyType shareStrategyType);

Callback Function

1
virtual void OnSetShareStrategyResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 Parameters

Parameter

Mandatory

Type

Description

shareStrategyType

Yes

HwmShareStrategyType

Screen sharing policy types

Table 2 Enumerated values of HwmShareStrategyType

Enumerated Value

Description

HWM_SHARE_STRATEGY_DEFINITION_FIRST

Clarity preferred

HWM_SHARE_STRATEGY_FLUENCY_FIRST

Fluency preferred

Return Values

Table 3 Return values

Type

Description

HwmErrCode

If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
/**
* Set a sharing policy.
*/
void demoSetShareStrategyDlg::OnBnClickedButtonSetShareStrategy()
{
    hwmsdkagent::HwmShareStrategyType type = HWM_SHARE_STRATEGY_DEFINITION_FIRST;
    int ret = hwmsdkagent::SetShareStrategy(type);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Set Share Strategy Result failed"));
    }
}