Starting Sharing
StartShare
API Description
This API is used to enable meeting sharing. The UI of the SDK has implemented the sharing function. You can call this API to initiate sharing on a third-party application.
Precautions
- If this API is called when you are not in a meeting, a failure message is returned.
- 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
1
|
HWM_SDK_AGENT_API hwmsdk::HwmErrCode StartShare(HwmStartShareInfo *startShareInfo); |
Callback Function
1
|
virtual void OnStartShareResult(hwmsdk::HwmErrCode ret, const char* reason) {}; |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
shareType |
Yes |
enum |
Sharing type. |
monitorShareInfo |
No |
HwmMonitorShareInfo |
Desktop sharing details. This parameter is mandatory if the sharing type is desktop sharing. |
appShareInfo |
No |
HwmAppShareInfo |
Program sharing details. This parameter is mandatory if the sharing type is program sharing. |
operatableUiMonitor |
Yes |
HwmMonitorShareInfo |
Monitor where the toolbar is located during sharing. If monitorMode is set to the primary/secondary monitor mode and the value of monitor is set to 0, you do not need to specify a monitor. |
Enumerated Value |
Description |
---|---|
HWM_SHARE_TYPE_MONITOR |
Desktop sharing. |
HWM_SHARE_TYPE_APP |
Program sharing. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
monitor |
Yes |
HwmMonitor |
Monitor type. This parameter is valid only when monitorMode is set to the primary/secondary monitor mode. |
monitorMode |
Yes |
HwmMonitorMode |
Monitor mode. |
monitorIndex |
Yes |
unsigned int |
Monitor index. This parameter is valid only when monitorMode is set to the multi-screen mode. |
Enumerated Value |
Description |
---|---|
HWM_MONITOR_MAIN |
Primary monitor. |
HWM_MONITOR_SECONDARY |
Secondary monitor. |
Enumerated Value |
Description |
---|---|
HWM_MONITOR_MODE_PRIMARY_SECONDARY |
Primary/Secondary monitor. |
HWM_MONITOR_MODE_MULTI_MONITOR |
Multi-monitor. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
appHandle |
Yes |
HWND |
Program handle. |
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 13 14 15 16 17 |
/** * Starts sharing. */ int demoStartShareDlg::clickStartShare() { hwmsdkagent::HwmStartShareInfo data; memset(&data, 0, sizeof(hwmsdkagent::HwmStartShareInfo)); // Set the sharing type. data.shareType = hwmsdkagent::HwmShareType::HWM_SHARE_TYPE_MONITOR; // Set the monitor to share. data.monitorShareInfo.monitor = hwmsdkagent::HWM_MONITOR_MAIN; // Set the monitor where the toolbar is located. data.operatableUiMonitor = hwmsdkagent::HWM_MONITOR_MAIN; int ret = hwmsdkagent::StartShare(&data); return ret; } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot