Making Windows Transparent During Screen Sharing
SetTransparentWnd
API Description
This API is used to make windows transparent during screen sharing.
Precautions
- Up to four window handles are supported.
- 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 SetTransparentWnd(HWND handle[], unsigned int count); |
Callback Function
1
|
virtual void OnSetTransparentWndResult(hwmsdk::HwmErrCode ret, const char* reason) {}; |
Parameter Description
Parameter |
Type |
Description |
---|---|---|
handle |
HWND[] |
Window handles. |
count |
unsigned int |
Number of window handles. |
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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
/** * Make windows transparent during screen sharing. */ void demoSetTransparentWndDlg::OnBnClickedOk() { CString tempCString; m_wndsEdit.GetWindowText(tempCString); std::string tempString = CTools::UNICODE2UTF(tempCString.GetString()); vector<std::string> list = CTools::split(tempString, ';'); std::string temp; int count = list.size(); int realCount = 0; if (count > 0) { // Apply for the structure memory. HWND* handles; handles = (HWND*)malloc(sizeof(HWND) * count); if (handles == NULL) { return -1; } memset(handles, 0, sizeof(HWND)*count); HWND* handlesTemp = handles; for (int i = 0; i < count; i++) { temp = list[i]; *handlesTemp = CTools::str2hwnd(temp); handlesTemp++; realCount++; } int ret = hwmsdkagent::SetTransparentWnd(handles, realCount); // Release memory space. free(handles); handles = NULL; if (hwmsdk::HWM_COMMON_SUCCESS != ret) { AfxMessageBox(_T("get error message error")); return; } } } |
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