I found the answer, it was easy. Just a couple lines of code. here he is:
cv::namedWindow("test",cv::WINDOW_AUTOSIZE); hWnd2 = (HWND) cvGetWindowHandle("test"); hParent = ::GetParent(hWnd2); ::SetParent(hWnd2, hParent); ::ShowWindow(hParent, SW_HIDE);
source share