]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mediactrl.cpp
compilation fix: last commit broke non-Win64 compilation
[wxWidgets.git] / src / msw / mediactrl.cpp
index 2144d317d1b657c00d0cf1d35be9f7022ba5e90d..6f65bf9987fda91d8fb89090f5dbb8caecc78e88 100644 (file)
@@ -27,8 +27,6 @@
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
-#define wxUSE_DIRECTSHOW 0
-#define wxUSE_QUICKTIME 0
 
 //---------------------------------------------------------------------------
 // Includes
@@ -1305,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) );
@@ -1325,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;
 }
@@ -1858,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;
 }
@@ -2065,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) );
+        }
     }
 }
 
@@ -2136,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);