How to add OpenCV display window as child of another window in Win32 c++ Applications?

c++, opencv, win32gui

Solution

I found the answer, it was soo easy. Just couple of lines of code. here it is :

cv::namedWindow("test",cv::WINDOW_AUTOSIZE);                        
hWnd2 = (HWND) cvGetWindowHandle("test"); 
hParent = ::GetParent(hWnd2);       
::SetParent(hWnd2, hParent); 
::ShowWindow(hParent, SW_HIDE);

Problem

I have a framegrabber (Silicon Software ) and I managed to show the grabbed images from a pointer in memory buffer using OpenCV. Now I want to create an application (Win32) and place the openCV window as a child window of the main application window. Anybody has any idea?

Original source