www.pudn.com > VideoCapture.rar > PropertyDlg.cpp


// PropertyDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Multicard.h" 
#include "PropertyDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CPropertyDlg dialog 
 
CPropertyDlg::CPropertyDlg(int iCardID,CWnd* pParent /*=NULL*/) 
	: CDialog(CPropertyDlg::IDD, pParent), 
		m_iCardID(iCardID) 
{ 
	//{{AFX_DATA_INIT(CPropertyDlg) 
	m_id = -1; 
	//}}AFX_DATA_INIT 
} 
 
 
void CPropertyDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPropertyDlg) 
	DDX_Radio(pDX, IDC_RADIO1, m_id); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog) 
	//{{AFX_MSG_MAP(CPropertyDlg) 
	ON_BN_CLICKED(IDC_DISPLAY_PROPERTY, OnDisplayProperty) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPropertyDlg message handlers 
 
BOOL CPropertyDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	char szCaption[20]; 
	sprintf(szCaption, "%dºÅ¿¨: ö¾ÙÊôÐÔÒ³", m_iCardID); 
	SetWindowText(szCaption); 
	 
	// TODO: Add extra initialization here 
	m_id = -1; 
	 
	BOOL bSupport; 
	for(int i=11; i>=0; i--) 
	{ 
		DSStream_IsPropertyExist(m_iCardID, (PropertyDialog)i, &bSupport); 
		GetDlgItem(IDC_RADIO1+i)->EnableWindow(bSupport); 
		if(bSupport) 
			m_id = i; 
	} 
	UpdateData(FALSE); 
	 
	if(m_id==-1) 
		GetDlgItem(IDC_DISPLAY_PROPERTY)->EnableWindow(FALSE); 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CPropertyDlg::OnDisplayProperty()  
{ 
	// TODO: Add your control notification handler code here 
	UpdateData(); 
	 
	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id) 
		DSStream_DisconnectPin(m_iCardID, PREVIEW); 
	 
	DSStream_DisplayPropertyDialogs(m_iCardID, (PropertyDialog)m_id, m_hWnd); 
	 
	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id) 
		DSStream_ConnectPin(m_iCardID, PREVIEW); 
	 
}