Ask Your Question

Alternative of cvGetWindowHandle() in opencv4+

asked 2019-11-06 18:03:10 -0500

Hi. I am using Opencv3.4.8 in my MFC application. I am using cvGetWindowHandle() to get the handle of the window as follows;

namedWindow(windowname, WINDOW_AUTOSIZE);
HWND hWnd = (HWND) cvGetWindowHandle(windowname.c_str());
HWND hParent = ::GetParent(hWnd);
::SetParent(hWnd, GetDlgItem(IDC_PICTURE)->m_hWnd);
::ShowWindow(hParent, SW_HIDE);
CWnd* pWnd = new CWnd();

Now I want to upgrade to Opencv4+ and there is no cvGetWindowHandle() in Opencv4+. I want to know if there is an alternative function in Opencv4+ and if not how can I do the same task in opencv4+.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-11-07 02:08:59 -0500

berak gravatar image

updated 2019-11-07 11:12:58 -0500

#include<opencv2/highgui/highgui_c.h> might still work.

in the long run, the C-api is on the way out, try not to rely on it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-11-06 18:03:10 -0500

Seen: 22 times

Last updated: Nov 07