【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,MCIWavPlayDLG.cpp,希望对大家有所帮助!
// MCIWavPlayDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MCIWavPlay.h"
#include "MCIWavPlayDlg.h"
#ifdef _DEBUG
#define new D
EBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overri
des //{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMCIWavPlayDlg dialog
CMCIWavPlayDlg::CMCIWavPlayDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMCIWavPlayDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMCIWavPlayDlg)
m_strbits = _T("");
m_strChannel = _T("");
m_strname = _T("");
m_strtime = _T("");
m_strSample = _T("");
m_strstatus = _T("");
//}}AFX_DATA_INIT
//
Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMCIWavPlayDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMCIWavPlayDlg)
DDX_Control(pDX, IDC_LIST1, m_List);
DDX_Text(pDX, IDC_BITS, m_strbits);
DDX_Text(pDX, IDC_CHANNEL, m_strChannel);
DDX_Text(pDX, IDC_FILENAME, m_strname);
DDX_Text(pDX, IDC_FILETIME, m_strtime);
DDX_Text(pDX, IDC_SAMPLERATE, m_strSample);
DDX_Text(pDX, IDC_STATUS, m_strstatus);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMCIWavPlayDlg, CDialog)
//{{AFX_MSG_MAP(CMCIWavPlayDlg)
ON_WM_SYS
COMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_OPENWAV, OnOpenwav)
ON_BN_CLICKED(IDC_PLAYWAV, OnPlaywav)
ON_BN_CLICKED(IDC_RECORDWAV, OnRecordwav)
ON_BN_CLICKED(IDC_SAVEWAV, OnSavewav)
ON_BN_CLICKED(IDC_STOPWAV, OnStopwav)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMCIWavPlayDlg message handlers
BOOL CMCIWavPlayDlg::OnInitDia
log()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->
AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); //
Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
GetDlgItem(IDC_PLAYWAV)->EnableWindow(FALSE); // 使"播放"按钮操作无效
GetDlgItem(IDC_SAVEWAV)->EnableWindow(FALSE); // 使"保存"按钮操作无效
GetDlgItem(IDC_STOPWAV)->EnableWindow(FALSE); // 使"停止"按钮操作无效