// PlayBack.cpp : implementation file // #include "stdafx.h" #include "StoneU_HC_OCX.h" #include "PlayBack.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPlayBack dialog CPlayBack::CPlayBack(CWnd* pParent /*=NULL*/) : CDialog(CPlayBack::IDD, pParent) { //{{AFX_DATA_INIT(CPlayBack) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CPlayBack::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPlayBack) DDX_Control(pDX, IDC_TABPLAYBACK, m_PlayTab); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPlayBack, CDialog) //{{AFX_MSG_MAP(CPlayBack) ON_NOTIFY(TCN_SELCHANGE, IDC_TABPLAYBACK, OnSelchangeTabplayback) ON_NOTIFY(TCN_SELCHANGING, IDC_TABPLAYBACK, OnSelchangingTabplayback) ON_BN_CLICKED(IDEXIT, OnExit) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPlayBack message handlers BOOL CPlayBack::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_PlayTab.InsertItem(0,"远程文件"); m_RemotePlayDlg.Create(IDD_SUBDLG_REMOTEFILE,&m_PlayTab); m_RemotePlayDlg.ShowWindow(SW_HIDE); m_PlayTab.InsertItem(1,"本地文件"); m_LocalPlayDlg.Create(IDD_SUBDLG_LOCALFILE,&m_PlayTab); m_LocalPlayDlg.ShowWindow(SW_SHOW); m_PlayTab.InsertItem(2,"时间回放"); m_RemoteTimePlayDlg.Create(IDD_SUBDLG_REMOTETIME, &m_PlayTab); m_RemoteTimePlayDlg.ShowWindow(SW_HIDE); HWND hParentWnd[2]={m_hWnd, m_PlayTab.m_hWnd}; m_LocalPlayDlg.SetParentWnd(hParentWnd, 2); m_RemotePlayDlg.SetParentWnd(hParentWnd, 2); m_RemoteTimePlayDlg.SetParentWnd(hParentWnd, 2); m_PlayTab.SetCurSel( 1 ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPlayBack::OnSelchangeTabplayback(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here switch(m_PlayTab.GetCurSel()) { case 0: m_RemotePlayDlg.ShowWindow(SW_SHOW); m_LocalPlayDlg.ShowWindow(SW_HIDE); m_RemoteTimePlayDlg.ShowWindow(SW_HIDE); break; case 1: m_RemotePlayDlg.ShowWindow(SW_HIDE); m_LocalPlayDlg.ShowWindow(SW_SHOW); m_RemoteTimePlayDlg.ShowWindow(SW_HIDE); break; case 2: m_RemotePlayDlg.ShowWindow(SW_HIDE); m_LocalPlayDlg.ShowWindow(SW_HIDE); m_RemoteTimePlayDlg.ShowWindow(SW_SHOW); break; default: break; } *pResult = 0; } void CPlayBack::OnSelchangingTabplayback(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here switch(m_PlayTab.GetCurSel()) { case 0: m_RemotePlayDlg.ShowWindow(SW_SHOW); m_LocalPlayDlg.ShowWindow(SW_HIDE); m_RemoteTimePlayDlg.ShowWindow(SW_HIDE); break; case 1: m_RemotePlayDlg.ShowWindow(SW_HIDE); m_LocalPlayDlg.ShowWindow(SW_SHOW); m_RemoteTimePlayDlg.ShowWindow(SW_HIDE); break; case 2: m_RemotePlayDlg.ShowWindow(SW_HIDE); m_LocalPlayDlg.ShowWindow(SW_HIDE); m_RemoteTimePlayDlg.ShowWindow(SW_SHOW); break; default: break; } *pResult = 0; } void CPlayBack::OnExit() { // TODO: Add your control notification handler code here m_RemotePlayDlg.F_Exit(); m_LocalPlayDlg.F_Stop(); m_RemoteTimePlayDlg.F_StopPlay(); CDialog::OnCancel(); } void CPlayBack::OnCancel() { // TODO: Add extra cleanup here // CDialog::OnCancel(); }