From 4552ff988a36c3ec8a663b6ee13ef36c051bade0 Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sat, 5 Jan 2008 23:39:28 +0000 Subject: [PATCH] pause sound when interacting with non-client area git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@264 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/win32/MainWnd.cpp | 22 ++++++++++++++++++++++ src/win32/MainWnd.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index 4bda38f1..ce126b6b 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -452,6 +452,8 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd) ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_OALCONFIGURATION, &MainWnd::OnUpdateOutputapiOalconfiguration) ON_COMMAND(ID_RENDERAPI_D3DMOTIONBLUR, &MainWnd::OnRenderapiD3dmotionblur) ON_UPDATE_COMMAND_UI(ID_RENDERAPI_D3DMOTIONBLUR, &MainWnd::OnUpdateRenderapiD3dmotionblur) + ON_WM_NCLBUTTONDOWN() + ON_WM_WINDOWPOSCHANGING() END_MESSAGE_MAP() @@ -1329,3 +1331,23 @@ LRESULT MainWnd::OnMySysCommand(WPARAM wParam, LPARAM lParam) } return Default(); } + +void MainWnd::OnNcLButtonDown(UINT nHitTest, CPoint point) +{ + // pause sound before process is halted + if( emulating ) { + soundPause(); + } + + CWnd::OnNcLButtonDown(nHitTest, point); +} + +void MainWnd::OnWindowPosChanging(WINDOWPOS* lpwndpos) +{ + CWnd::OnWindowPosChanging(lpwndpos); + + // pause sound before changing window position/size + if( emulating ) { + soundPause(); + } +} diff --git a/src/win32/MainWnd.h b/src/win32/MainWnd.h index b093a27b..00013a3a 100644 --- a/src/win32/MainWnd.h +++ b/src/win32/MainWnd.h @@ -445,6 +445,8 @@ public: afx_msg void OnSizing(UINT fwSide, LPRECT pRect); afx_msg void OnRenderapiD3dmotionblur(); afx_msg void OnUpdateRenderapiD3dmotionblur(CCmdUI *pCmdUI); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos); }; /////////////////////////////////////////////////////////////////////////////