X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f5000cf01639bf00dd59091f76b16e11939c3b8..e7f28a5864ef3e6bacbfa8e96345e02d65e2b333:/src/msw/mediactrl.cpp diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index b047783ab5..6f65bf9987 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -1303,13 +1303,15 @@ bool wxAMMediaBackend::Load(const wxString& fileName) #if defined(_WIN32) ::SetWindowLong(m_hNotifyWnd, GWL_WNDPROC, (LONG)wxAMMediaBackend::NotifyWndProc); + ::SetWindowLong(m_hNotifyWnd, GWL_USERDATA, + (LONG) this); #else ::SetWindowLongPtr(m_hNotifyWnd, GWLP_WNDPROC, (LONG_PTR)wxAMMediaBackend::NotifyWndProc); + ::SetWindowLongPtr(m_hNotifyWnd, GWL_USERDATA, + (LONG) this); #endif - ::SetWindowLong(m_hNotifyWnd, GWL_USERDATA, - (LONG) this); wxAMVERIFY( m_pME->SetNotifyWindow((LONG_PTR)m_hNotifyWnd, WM_GRAPHNOTIFY, 0) ); @@ -1323,6 +1325,7 @@ bool wxAMMediaBackend::Load(const wxString& fileName) m_ctrl->GetParent()->Layout(); m_ctrl->GetParent()->Refresh(); m_ctrl->GetParent()->Update(); + m_ctrl->SetSize(m_ctrl->GetSize()); return true; } @@ -1856,6 +1859,7 @@ bool wxMCIMediaBackend::Load(const wxString& fileName) m_ctrl->GetParent()->Layout(); m_ctrl->GetParent()->Refresh(); m_ctrl->GetParent()->Update(); + m_ctrl->SetSize(m_ctrl->GetSize()); return true; } @@ -2063,14 +2067,19 @@ void wxMCIMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y), if (m_hNotifyWnd && m_bVideo) { MCI_DGV_RECT_PARMS putParms; //ifdefed MCI_DGV_PUT_PARMS - putParms.rc.top = 0; - putParms.rc.bottom = 0; - putParms.rc.right = w; + memset(&putParms, 0, sizeof(MCI_DGV_RECT_PARMS)); putParms.rc.bottom = h; - - wxMCIVERIFY( mciSendCommand(m_hDev, MCI_PUT, + putParms.rc.right = w; + + //wxStackWalker will crash and burn here on assert + //and mci doesn't like 0 and 0 for some reason (out of range ) + //so just don't it in that case + if(w || h) + { + wxMCIVERIFY( mciSendCommand(m_hDev, MCI_PUT, 0x00040000L, //MCI_DGV_PUT_DESTINATION (DWORD)(LPSTR)&putParms) ); + } } } @@ -2134,7 +2143,11 @@ LRESULT CALLBACK wxMCIMediaBackend::NotifyWndProc(HWND hWnd, UINT nMsg, LPARAM lParam) { wxMCIMediaBackend* backend = (wxMCIMediaBackend*) +#ifdef _WIN32 ::GetWindowLong(hWnd, GWL_USERDATA); +#else + ::GetWindowLongPtr(hWnd, GWLP_USERDATA); +#endif wxASSERT(backend); return backend->OnNotifyWndProc(hWnd, nMsg, wParam, lParam);