Obtaining Information About the Main Window
GetMainWindowInfo
API Description
This API is used to obtain information about the main window.
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
1
|
HWM_SDK_AGENT_API hwmsdk::HwmErrCode GetMainWindowInfo(); |
Callback Function
1
|
virtual void OnGetMainWindowInfoResult(hwmsdk::HwmErrCode ret, const char* reason, const HwmMainWindowInfo *mainWindowInfo) {}; |
Parameter Description
Parameter |
Type |
Description |
---|---|---|
x |
int |
Offset of the window relative to the left side of the screen. |
y |
int |
Offset of the window relative to the top of the screen. |
width |
int |
Width of the window. |
height |
int |
Height of the window. |
handle |
HWND |
Window handle. |
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. |
Main window information. |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 |
/** * Obtain information about the main window. */ void demoGetMainWindowInfoDlg::OnBnClickedOk() { int ret = hwmsdkagent::GetMainWindowInfo(); if (hwmsdk::HWM_COMMON_SUCCESS != ret) { AfxMessageBox(_T("get mainwindow info 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