I can play a video ok in Win32 by using the windows media control… see code below. However I can’t figure out how to put anything (eg image) in front of the video playing… I tried using SetWindowPos (last line of the code below) but it didn’t seem to change the z-order at all. Anyone got any ideas?, is there a better way to play videos in Win32 for cocos2d-x?
CAxWindow m_wndView; // ActiveX host window class.
CComPtr m_spWMPPlayer; // Smart pointer to IWMPPlayer interface.
AtlAxWinInit();
CComPtr spHost;
HRESULT hr;
RECT rect = {xCoord,yCoord,xCoord + width,yCoord + height};
HWND hwndReturned = m_wndView.Create(CCDirector::sharedDirector()->getOpenGLView()->getHWnd(), rect, 0, WS_CHILD | WS_VISIBLE);
hr = m_wndView.QueryHost(&spHost);
if ( SUCCEEDED( hr ) )
hr = spHost->CreateControl(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0);
if ( SUCCEEDED( hr ) )
hr = m_wndView.QueryControl(&m_spWMPPlayer);
m_spWMPPlayer->put_windowlessVideo(VARIANT_TRUE);
BSTR bsURL = SysAllocString(L"C:\\Temp\\1_IntroMovie.mov");
m_spWMPPlayer->put_URL(bsURL);
BSTR uiMode = SysAllocString(L"none");
m_spWMPPlayer->put_uiMode(uiMode);
SetWindowPos(hwndReturned,HWND_BOTTOM,xCoord,yCoord,height, 700,SWP_NOMOVE); //THIS DOESN'T SEEM TO DO ANYTHING OTHER THAN CHANGE WINDOW SIZE, THE HWND_BOTTOM DOESNT HAVE AN EFFECT