Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasimir666 <casimir666@users.sourceforge.net>2007-05-31 22:52:22 +0400
committerCasimir666 <casimir666@users.sourceforge.net>2007-05-31 22:52:22 +0400
commit2a46935846d72162f88042df15ac3a855f814946 (patch)
tree1120a16b008e724117090ce52451e247c5f1691b /src/apps/mplayerc/VMROSD.cpp
parent834c41e814868584a0b29b02f235bbc676f579e9 (diff)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@127 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/VMROSD.cpp')
-rw-r--r--src/apps/mplayerc/VMROSD.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/apps/mplayerc/VMROSD.cpp b/src/apps/mplayerc/VMROSD.cpp
index ac919f984..c155003c6 100644
--- a/src/apps/mplayerc/VMROSD.cpp
+++ b/src/apps/mplayerc/VMROSD.cpp
@@ -184,17 +184,20 @@ void CVMROSD::Stop()
void CVMROSD::CalcRect()
{
- m_pWnd->GetClientRect(&m_rectWnd);
+ if (m_pWnd)
+ {
+ m_pWnd->GetClientRect(&m_rectWnd);
- m_rectSeekBar.left = m_rectWnd.left + 10;
- m_rectSeekBar.right = m_rectWnd.right - 10;
- m_rectSeekBar.top = m_rectWnd.bottom - SEEKBAR_HEIGHT;
- m_rectSeekBar.bottom = m_rectSeekBar.top + SEEKBAR_HEIGHT;
+ m_rectSeekBar.left = m_rectWnd.left + 10;
+ m_rectSeekBar.right = m_rectWnd.right - 10;
+ m_rectSeekBar.top = m_rectWnd.bottom - SEEKBAR_HEIGHT;
+ m_rectSeekBar.bottom = m_rectSeekBar.top + SEEKBAR_HEIGHT;
- m_rectSeekBar.left = m_rectSeekBar.left;
- m_rectSeekBar.right = m_rectSeekBar.right;
- m_rectSeekBar.top = m_rectSeekBar.top;
- m_rectSeekBar.bottom = m_rectSeekBar.bottom;
+ m_rectSeekBar.left = m_rectSeekBar.left;
+ m_rectSeekBar.right = m_rectSeekBar.right;
+ m_rectSeekBar.top = m_rectSeekBar.top;
+ m_rectSeekBar.bottom = m_rectSeekBar.bottom;
+ }
}
void CVMROSD::DrawRect(CRect* rect, CBrush* pBrush, CPen* pPen)
@@ -281,7 +284,8 @@ void CVMROSD::UpdateSeekBarPos(CPoint point)
m_llSeekPos = max (m_llSeekPos, m_llSeekMin);
m_llSeekPos = min (m_llSeekPos, m_llSeekMax);
- AfxGetApp()->GetMainWnd()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)m_llSeekPos, SB_THUMBTRACK), (LPARAM)m_pWnd->m_hWnd);
+ if (m_pWnd)
+ AfxGetApp()->GetMainWnd()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)m_llSeekPos, SB_THUMBTRACK), (LPARAM)m_pWnd->m_hWnd);
}
bool CVMROSD::OnMouseMove(UINT nFlags, CPoint point)
@@ -398,8 +402,12 @@ void CVMROSD::DisplayMessage (OSD_MESSAGEPOS nPos, LPCTSTR strMsg, int nDuration
{
m_nMessagePos = nPos;
m_strMessage = strMsg;
- KillTimer(m_pWnd->m_hWnd, (long)this);
- if (nDuration != -1) SetTimer(m_pWnd->m_hWnd, (long)this, nDuration, TimerFunc);
+
+ if (m_pWnd)
+ {
+ KillTimer(m_pWnd->m_hWnd, (long)this);
+ if (nDuration != -1) SetTimer(m_pWnd->m_hWnd, (long)this, nDuration, TimerFunc);
+ }
Invalidate();
}
}