【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,INFODLG.CPP,希望对大家有所帮助!
//=============================================================================
// Copyright Langis Pitre 1998
// You may do whatever you want with this code, as long as you include this
// copyright notice in your implementation files.
//
// If you wish to add new classes to this collection, feel free to do so.
// But please send me your code so that I can update the collection.
//
// Comments and bug reports: lpitre@sympatico.ca
//
//=============================================================================
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
//
// InfoDlg.cpp : CInfoDlg class implementation file
//
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
#include "stdafx.h"
#include "mixercontrols.h"
#include "InfoDlg.h"
#include "mmreg.h"
#include "MixerBase.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// type of object to insert in the tree control and info structures
enum { TYPE_ROOT, TYPE_DSTLINE, TYPE_SRCLINE, TYPE_DSTCTRL, TYPE_SRCCTRL };
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
inline DWORD MakeLParam( int m, int n, int o, int p )
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
{
return(MAKELPARAM(MAKEWORD(BYTE(m),BYTE(n)),MAKEWORD(BYTE(o),BYTE(p))));
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : CInfoDlg
//
// Descr. :
//
// Arg : CWnd* pParent /*=NULL*/ :
//-----------------------------------------------------------------------------
CInfoDlg::CInfoDlg( CWnd* pParent /*=NULL*/ ) : CDialog( CInfoDlg::IDD, pParent )
{
//{{AFX_DATA_INIT( CInfoDlg )
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : DoDataExchange
//
// Descr. :
//
// Return : void
// Arg : CDataExchange* pDX :
//-----------------------------------------------------------------------------
void CInfoDlg::DoDataExchange( CDataExchange* pDX )
{
CDialog::DoDataExchange( pDX );
//{{AFX_DATA_MAP( CInfoDlg )
DDX_Control( pDX, IDC_INFO_LIST, m_InfoList );
DDX_Control( pDX, IDC_INFO_TREE, m_InfoTree );
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP( CInfoDlg, CDialog )
//{{AFX_MSG_MAP( CInfoDlg )
ON_NOTIFY( TVN_SELCHANGED, IDC_INFO_TREE, OnSelchangedInfoTree )
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : OnInitDialog
//
// Descr. :
//
// Return : BOOL
//-----------------------------------------------------------------------------
BOOL CInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_ImageList.Create( IDB_TREE_BITMAP, 16, 0, RGB(255,255,255) );
m_InfoTree.SetImageList( &m_ImageList, TVSIL_NORMAL );
FillMixerInfoTree();
return TRUE;
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : FillMixerInfoTree
//
// Descr. : Fills the CapsInfo structure and the tree control with the
// mixer device capabilities, i.e. all the audio lines and controls
// available. For every new tree control item added, the lParam
// field is used to store the type of mixer object it refers to, as
// well as the destination line index, the source line index, and the
// mixer control index ( 4 bytes of the 32-bit value ). The MakeLParam
// inline function is used to construct the lParam from the 4 fields.
//
// Return : void
//--------------------------------------------------------