打开Halcon窗口函数声明及定义
HTuple OpenWindow_(CWnd* pWnd)
{
CRect rect;
HTuple Row, Col, Width, Height;
HTuple FatherWindow;
HTuple WindowHandle;
Row = Col = 0;
pWnd->GetClientRect(rect);
Width = rect.Width();
Height = rect.Height();
FatherWindow = (Hlong)(pWnd->m_hWnd);
HalconCpp::SetWindowAttr("background_color", "gray");
HalconCpp::OpenWindow(Row, Col, Width, Height, FatherWindow, "visible", "", &WindowHandle);
return WindowHandle;
}
调用时
CWnd* pWnd; HTuple hv_WindowHandle; //获得图片控件 pWnd = GetDlgItem(IDC_SHOW_WND); //获得了Halcon窗口句柄,就可以进行进一步操作了 hv_WindowHandle = OpenWindow_(pWnd);



